diff options
author | Jubin John <jubin.john@intel.com> | 2016-02-26 13:33:33 -0800 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-03-10 20:45:47 -0500 |
commit | 79d0c088801b221330ee3b75cd10912003e3c6dd (patch) | |
tree | 701e113e6ae1322ad181b78e26cd322919555057 /drivers/staging/rdma/hfi1/pio.c | |
parent | 409b146225cdefcc76d9956e323e84e510208884 (diff) |
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/pio.c')
-rw-r--r-- | drivers/staging/rdma/hfi1/pio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rdma/hfi1/pio.c b/drivers/staging/rdma/hfi1/pio.c index 859cb4601547..361b43d47c76 100644 --- a/drivers/staging/rdma/hfi1/pio.c +++ b/drivers/staging/rdma/hfi1/pio.c @@ -1881,7 +1881,7 @@ void free_pio_map(struct hfi1_devdata *dd) /* Free PIO map if allocated */ if (rcu_access_pointer(dd->pio_map)) { spin_lock_irq(&dd->pio_map_lock); - kfree(rcu_access_pointer(dd->pio_map)); + pio_map_free(rcu_access_pointer(dd->pio_map)); RCU_INIT_POINTER(dd->pio_map, NULL); spin_unlock_irq(&dd->pio_map_lock); synchronize_rcu(); |