projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
390d3fd
)
RDMA/hfi1: Prevent memory leak in sdma_init
author
Navid Emamdoost
<navid.emamdoost@gmail.com>
Wed, 25 Sep 2019 14:45:42 +0000
(09:45 -0500)
committer
Jason Gunthorpe
<jgg@mellanox.com>
Tue, 1 Oct 2019 14:34:55 +0000
(11:34 -0300)
In sdma_init if rhashtable_init fails the allocated memory for
tmp_sdma_rht should be released.
Fixes:
5a52a7acf7e2
("IB/hfi1: NULL pointer dereference when freeing rhashtable")
Link:
https://lore.kernel.org/r/20190925144543.10141-1-navid.emamdoost@gmail.com
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hfi1/sdma.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/hw/hfi1/sdma.c
b/drivers/infiniband/hw/hfi1/sdma.c
index
2395fd4
..
2ed7bfd
100644
(file)
--- a/
drivers/infiniband/hw/hfi1/sdma.c
+++ b/
drivers/infiniband/hw/hfi1/sdma.c
@@
-1526,8
+1526,11
@@
int sdma_init(struct hfi1_devdata *dd, u8 port)
}
ret = rhashtable_init(tmp_sdma_rht, &sdma_rht_params);
- if (ret < 0)
+ if (ret < 0) {
+ kfree(tmp_sdma_rht);
goto bail;
+ }
+
dd->sdma_rht = tmp_sdma_rht;
dd_dev_info(dd, "SDMA num_sdma: %u\n", dd->num_sdma);