summaryrefslogtreecommitdiff
path: root/drivers/staging/rdma/hfi1/init.c
diff options
context:
space:
mode:
authorJubin John <jubin.john@intel.com>2016-02-26 21:33:33 (GMT)
committerDoug Ledford <dledford@redhat.com>2016-03-11 01:45:47 (GMT)
commit79d0c088801b221330ee3b75cd10912003e3c6dd (patch)
tree701e113e6ae1322ad181b78e26cd322919555057 /drivers/staging/rdma/hfi1/init.c
parent409b146225cdefcc76d9956e323e84e510208884 (diff)
downloadlinux-79d0c088801b221330ee3b75cd10912003e3c6dd.tar.xz
staging/rdma/hfi1: Fix memory leaks
Fix 3 memory leaks reported by the LeakCheck tool in the KEDR framework. The following resources were allocated memory during their respective initializations but not freed during cleanup: 1. SDMA map elements 2. PIO map elements 3. HW send context to SW index map This patch fixes the memory leaks by freeing the allocated memory in the cleanup path. Reviewed-by: Dean Luick <dean.luick@intel.com> Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/staging/rdma/hfi1/init.c')
-rw-r--r--drivers/staging/rdma/hfi1/init.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/rdma/hfi1/init.c b/drivers/staging/rdma/hfi1/init.c
index 371ed29..37b3ce8 100644
--- a/drivers/staging/rdma/hfi1/init.c
+++ b/drivers/staging/rdma/hfi1/init.c
@@ -1324,6 +1324,8 @@ static void cleanup_device_data(struct hfi1_devdata *dd)
dd->num_send_contexts = 0;
kfree(dd->send_contexts);
dd->send_contexts = NULL;
+ kfree(dd->hw_to_sw);
+ dd->hw_to_sw = NULL;
kfree(dd->boardname);
vfree(dd->events);
vfree(dd->status);