summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorRoland Dreier2009-02-23 05:04:34 +0100
committerRoland Dreier2009-02-23 05:04:34 +0100
commit71c4512201575c7cc008b364e2e2c75cc7085c26 (patch)
tree0a8d76992a500aa82e8943c3dd4743b3d3e3d6e0 /drivers/infiniband
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rol... (diff)
downloadkernel-qcow2-linux-71c4512201575c7cc008b364e2e2c75cc7085c26.tar.gz
kernel-qcow2-linux-71c4512201575c7cc008b364e2e2c75cc7085c26.tar.xz
kernel-qcow2-linux-71c4512201575c7cc008b364e2e2c75cc7085c26.zip
IB/ipath: Fix memory leak in init_shadow_tids() error path
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>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_init_chip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_init_chip.c b/drivers/infiniband/hw/ipath/ipath_init_chip.c
index 64aeefbd2a5d..077879c0bdb5 100644
--- 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;
}