Commit 60460dfd authored by Bryan O'Sullivan's avatar Bryan O'Sullivan Committed by Linus Torvalds
Browse files

[PATCH] IB/ipath: fix some memory leaks on failure paths


Signed-off-by: default avatarRobert Walsh <robert.walsh@qlogic.com>
Signed-off-by: default avatarBryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4a45b7d4
...@@ -115,6 +115,7 @@ static int create_port0_egr(struct ipath_devdata *dd) ...@@ -115,6 +115,7 @@ static int create_port0_egr(struct ipath_devdata *dd)
"eager TID %u\n", e); "eager TID %u\n", e);
while (e != 0) while (e != 0)
dev_kfree_skb(skbs[--e]); dev_kfree_skb(skbs[--e]);
vfree(skbs);
ret = -ENOMEM; ret = -ENOMEM;
goto bail; goto bail;
} }
......
...@@ -692,6 +692,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd, ...@@ -692,6 +692,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
case IB_QPT_GSI: case IB_QPT_GSI:
qp = kmalloc(sizeof(*qp), GFP_KERNEL); qp = kmalloc(sizeof(*qp), GFP_KERNEL);
if (!qp) { if (!qp) {
vfree(swq);
ret = ERR_PTR(-ENOMEM); ret = ERR_PTR(-ENOMEM);
goto bail; goto bail;
} }
...@@ -702,6 +703,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd, ...@@ -702,6 +703,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
qp->r_rq.wq = vmalloc(qp->r_rq.size * sz); qp->r_rq.wq = vmalloc(qp->r_rq.size * sz);
if (!qp->r_rq.wq) { if (!qp->r_rq.wq) {
kfree(qp); kfree(qp);
vfree(swq);
ret = ERR_PTR(-ENOMEM); ret = ERR_PTR(-ENOMEM);
goto bail; goto bail;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment