aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@pathscale.com>2006-09-28 11:59:58 -0400
committerRoland Dreier <rolandd@cisco.com>2006-09-28 14:16:23 -0400
commit221e31985b490309eb9ae33ac815deae3b5aa021 (patch)
treeb18590bafe833354d80e03f2184d40d2e6ad4551 /drivers/infiniband/hw
parent6022943eb4cb3cb9e43f27f1faeaba38e162d966 (diff)
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>
Diffstat (limited to 'drivers/infiniband/hw')
-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 2108466c7e33..a01301d0753c 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,
1326 "for port %u rcvhdrqtailaddr failed\n", 1326 "for port %u rcvhdrqtailaddr failed\n",
1327 pd->port_port); 1327 pd->port_port);
1328 ret = -ENOMEM; 1328 ret = -ENOMEM;
1329 dma_free_coherent(&dd->pcidev->dev, amt,
1330 pd->port_rcvhdrq, pd->port_rcvhdrq_phys);
1331 pd->port_rcvhdrq = NULL;
1329 goto bail; 1332 goto bail;
1330 } 1333 }
1331 pd->port_rcvhdrqtailaddr_phys = phys_hdrqtail; 1334 pd->port_rcvhdrqtailaddr_phys = phys_hdrqtail;