[net,2/4] ibmvnic: Fix NAPI structures memory leak

Message ID 1518567823-7138-3-git-send-email-tlfalcon@linux.vnet.ibm.com
State Accepted
Delegated to: David Miller
Headers show
Series
  • ibmvnic: Fix memory leaks in the driver
Related show

Commit Message

Thomas Falcon Feb. 14, 2018, 12:23 a.m.
This memory is allocated during initialization but never freed,
so do that now.

Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 8625f5e..23e0b42 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -825,6 +825,8 @@  static void release_resources(struct ibmvnic_adapter *adapter)
 			}
 		}
 	}
+	kfree(adapter->napi);
+	adapter->napi = NULL;
 
 	release_login_rsp_buffer(adapter);
 }