]> git.baikalelectronics.ru Git - kernel.git/commit
i40iw: Fix memory leak in CQP destroy when in reset
authorMustafa Ismail <mustafa.ismail@intel.com>
Tue, 6 Dec 2016 21:49:32 +0000 (15:49 -0600)
committerDoug Ledford <dledford@redhat.com>
Mon, 12 Dec 2016 22:20:27 +0000 (17:20 -0500)
commitc676a1ff7b0116977a24bded071bb5b8043874f5
tree00dc69e884a1aac54c0a9c4e72e22f468c7c212e
parent5dc5856266118e12fde6b2e8c0648257dc9cdda7
i40iw: Fix memory leak in CQP destroy when in reset

On a device close, the control QP (CQP) is destroyed by calling
cqp_destroy which destroys the CQP and frees its SD buffer memory.
However, if the reset flag is true, cqp_destroy is never called and
leads to a memory leak on SD buffer memory. Fix this by always calling
cqp_destroy, on device close, regardless of reset. The exception to this
when CQP create fails. In this case, the SD buffer memory is already
freed on an error check and there is no need to call cqp_destroy.

Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/i40iw/i40iw_main.c