Skip to content

Commit

Permalink
[PATCH] IB/ipath: fix some memory leaks on failure paths
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Walsh <robert.walsh@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Bryan O'Sullivan authored and Linus Torvalds committed Jul 1, 2006
1 parent 4a45b7d commit 60460df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/infiniband/hw/ipath/ipath_init_chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ static int create_port0_egr(struct ipath_devdata *dd)
"eager TID %u\n", e);
while (e != 0)
dev_kfree_skb(skbs[--e]);
vfree(skbs);
ret = -ENOMEM;
goto bail;
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/infiniband/hw/ipath/ipath_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
case IB_QPT_GSI:
qp = kmalloc(sizeof(*qp), GFP_KERNEL);
if (!qp) {
vfree(swq);
ret = ERR_PTR(-ENOMEM);
goto bail;
}
Expand All @@ -702,6 +703,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
qp->r_rq.wq = vmalloc(qp->r_rq.size * sz);
if (!qp->r_rq.wq) {
kfree(qp);
vfree(swq);
ret = ERR_PTR(-ENOMEM);
goto bail;
}
Expand Down

0 comments on commit 60460df

Please sign in to comment.