In the Linux kernel, the following vulnerability has been resolved:
qlcnic: prevent ->dcb use-after-free on qlcnicdcbenable() failure
adapter->dcb would get silently freed inside qlcnicdcbenable() in case qlcnicdcbattach() would return an error, which always happens under OOM conditions. This would lead to use-after-free because both of the existing callers invoke qlcnicdcbget_info() on the obtained pointer, which is potentially freed at that point.
Propagate errors from qlcnicdcbenable(), and instead free the dcb pointer at callsite using qlcnicdcbfree(). This also removes the now unused qlcniccleardcb_ops() helper, which was a simple wrapper around kfree() also causing memory leaks for partially initialized dcb.
Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool.