* [PATCH] RDMA/cxgb4: Fix memory leaks in c4iw_alloc() error paths
@ 2014-04-21 15:02 Christoph Jaeger
[not found] ` <1398092562-11116-1-git-send-email-christophjaeger-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Christoph Jaeger @ 2014-04-21 15:02 UTC (permalink / raw)
To: swise, roland, sean.hefty, hal.rosenstock
Cc: linux-rdma, linux-kernel, Christoph Jaeger
c4iw_alloc() bails out without freeing the storage that 'devp' points to.
Picked up by Coverity - CID 1204241.
Fixes: fa658a98a2 ("RDMA/cxgb4: Use the BAR2/WC path for kernel QPs and T5 devices")
Signed-off-by: Christoph Jaeger <christophjaeger@linux.com>
---
drivers/infiniband/hw/cxgb4/device.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
index f4fa50a..8914ea9 100644
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@ -736,6 +736,7 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop)
pci_resource_len(devp->rdev.lldi.pdev, 2));
if (!devp->rdev.bar2_kva) {
pr_err(MOD "Unable to ioremap BAR2\n");
+ ib_dealloc_device(&devp->ibdev);
return ERR_PTR(-EINVAL);
}
} else if (ocqp_supported(infop)) {
@@ -747,6 +748,7 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop)
devp->rdev.lldi.vr->ocq.size);
if (!devp->rdev.oc_mw_kva) {
pr_err(MOD "Unable to ioremap onchip mem\n");
+ ib_dealloc_device(&devp->ibdev);
return ERR_PTR(-EINVAL);
}
}
--
1.9.0
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <1398092562-11116-1-git-send-email-christophjaeger-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>]
* RE: [PATCH] RDMA/cxgb4: Fix memory leaks in c4iw_alloc() error paths 2014-04-21 15:02 [PATCH] RDMA/cxgb4: Fix memory leaks in c4iw_alloc() error paths Christoph Jaeger @ 2014-04-21 15:16 ` Steve Wise 0 siblings, 0 replies; 3+ messages in thread From: Steve Wise @ 2014-04-21 15:16 UTC (permalink / raw) To: 'Christoph Jaeger', swise-ut6Up61K2wZBDgjK7y7TUQ, roland-DgEjT+Ai2ygdnm+yROfE0A, sean.hefty-ral2JQCrhuEAvxtiuMwx3w, hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA > -----Original Message----- > From: Christoph Jaeger [mailto:christophjaeger-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org] > Sent: Monday, April 21, 2014 10:03 AM > To: swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org; roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org; sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org; hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Christoph Jaeger > Subject: [PATCH] RDMA/cxgb4: Fix memory leaks in c4iw_alloc() error paths > > c4iw_alloc() bails out without freeing the storage that 'devp' points to. > > Picked up by Coverity - CID 1204241. > > Fixes: fa658a98a2 ("RDMA/cxgb4: Use the BAR2/WC path for kernel QPs and T5 devices") > Signed-off-by: Christoph Jaeger <christophjaeger-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org> Acked-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org> thanks! -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] RDMA/cxgb4: Fix memory leaks in c4iw_alloc() error paths @ 2014-04-21 15:16 ` Steve Wise 0 siblings, 0 replies; 3+ messages in thread From: Steve Wise @ 2014-04-21 15:16 UTC (permalink / raw) To: 'Christoph Jaeger', swise, roland, sean.hefty, hal.rosenstock Cc: linux-rdma, linux-kernel > -----Original Message----- > From: Christoph Jaeger [mailto:christophjaeger@linux.com] > Sent: Monday, April 21, 2014 10:03 AM > To: swise@chelsio.com; roland@kernel.org; sean.hefty@intel.com; hal.rosenstock@gmail.com > Cc: linux-rdma@vger.kernel.org; linux-kernel@vger.kernel.org; Christoph Jaeger > Subject: [PATCH] RDMA/cxgb4: Fix memory leaks in c4iw_alloc() error paths > > c4iw_alloc() bails out without freeing the storage that 'devp' points to. > > Picked up by Coverity - CID 1204241. > > Fixes: fa658a98a2 ("RDMA/cxgb4: Use the BAR2/WC path for kernel QPs and T5 devices") > Signed-off-by: Christoph Jaeger <christophjaeger@linux.com> Acked-by: Steve Wise <swise@opengridcomputing.com> thanks! ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-21 15:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-21 15:02 [PATCH] RDMA/cxgb4: Fix memory leaks in c4iw_alloc() error paths Christoph Jaeger
[not found] ` <1398092562-11116-1-git-send-email-christophjaeger-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
2014-04-21 15:16 ` Steve Wise
2014-04-21 15:16 ` Steve Wise
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.