[PATCH] IB/ipath: fix some memory leaks on failure paths
authorBryan O'Sullivan <bos@pathscale.com>
Sat, 1 Jul 2006 11:35:55 +0000 (04:35 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 1 Jul 2006 16:55:59 +0000 (09:55 -0700)
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>
drivers/infiniband/hw/ipath/ipath_init_chip.c
drivers/infiniband/hw/ipath/ipath_qp.c

index e9b5534f215a5ed292104bf307e5bda31b0eaebf..37cd96e96e3e4ae8796c01336d73670c75eccce7 100644 (file)
@@ -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;
                }
index e6fc4c02823f406ca13e37e323cc262bdbadb4ec..fd4d55bdee783b45fbcc6c8b4206955e853c3c75 100644 (file)
@@ -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;
                }
@@ -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;
                }