aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@pathscale.com>2006-09-28 08:59:58 -0700
committerRoland Dreier <rolandd@cisco.com>2006-09-28 11:16:23 -0700
commit221e31985b490309eb9ae33ac815deae3b5aa021 (patch)
treeb18590bafe833354d80e03f2184d40d2e6ad4551
parent6022943eb4cb3cb9e43f27f1faeaba38e162d966 (diff)
downloadlinux-221e31985b490309eb9ae33ac815deae3b5aa021.tar.gz
IB/ipath: Fix memory leak if allocation fails
If the second allocation failed, the first structure allocated in this routine was not freed. Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--drivers/infiniband/hw/ipath/ipath_driver.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index 2108466c7e3371..a01301d0753cec 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -1326,6 +1326,9 @@ int ipath_create_rcvhdrq(struct ipath_devdata *dd,
"for port %u rcvhdrqtailaddr failed\n",
pd->port_port);
ret = -ENOMEM;
+ dma_free_coherent(&dd->pcidev->dev, amt,
+ pd->port_rcvhdrq, pd->port_rcvhdrq_phys);
+ pd->port_rcvhdrq = NULL;
goto bail;
}
pd->port_rcvhdrqtailaddr_phys = phys_hdrqtail;