projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f3b8436
)
IB/ipath: Fix memory leak in init_shadow_tids() error path
author
Roland Dreier
<rolandd@cisco.com>
Mon, 23 Feb 2009 04:04:34 +0000
(20:04 -0800)
committer
Roland Dreier
<rolandd@cisco.com>
Mon, 23 Feb 2009 04:04:34 +0000
(20:04 -0800)
If the second vmalloc() fails, the wrong pointer is pased to vfree(), so
the first vmalloc() ends up getting leaked.
This was spotted by the Coverity checker (CID 2709).
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/ipath/ipath_init_chip.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/hw/ipath/ipath_init_chip.c
b/drivers/infiniband/hw/ipath/ipath_init_chip.c
index 64aeefbd2a5d74c09ad5debc4f0cfe0177ae7263..077879c0bdb51a63f19326b21cf6f5350f43f6fe 100644
(file)
--- a/
drivers/infiniband/hw/ipath/ipath_init_chip.c
+++ b/
drivers/infiniband/hw/ipath/ipath_init_chip.c
@@
-455,7
+455,7
@@
static void init_shadow_tids(struct ipath_devdata *dd)
if (!addrs) {
ipath_dev_err(dd, "failed to allocate shadow dma handle "
"array, no expected sends!\n");
- vfree(
dd->ipath_pageshadow
);
+ vfree(
pages
);
dd->ipath_pageshadow = NULL;
return;
}