diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-09-28 08:59:58 -0700 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-09-28 11:16:23 -0700 |
commit | 221e31985b490309eb9ae33ac815deae3b5aa021 (patch) | |
tree | b18590bafe833354d80e03f2184d40d2e6ad4551 | |
parent | 6022943eb4cb3cb9e43f27f1faeaba38e162d966 (diff) | |
download | kernel_samsung_aries-221e31985b490309eb9ae33ac815deae3b5aa021.zip kernel_samsung_aries-221e31985b490309eb9ae33ac815deae3b5aa021.tar.gz kernel_samsung_aries-221e31985b490309eb9ae33ac815deae3b5aa021.tar.bz2 |
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.c | 3 |
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 2108466..a01301d 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; |