]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
IB/ipoib: remove the unnecessary memory free
authorZhu Yanjun <yanjun.zhu@oracle.com>
Fri, 10 Feb 2017 06:48:42 +0000 (01:48 -0500)
committerDoug Ledford <dledford@redhat.com>
Sun, 19 Feb 2017 14:18:46 +0000 (09:18 -0500)
In the function ipoib_cm_nonsrq_init_rx, the memory is not
allocated successfully. It is not necessary to free it.

CC: Joe Jin <joe.jin@oracle.com>
CC: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/ipoib/ipoib_cm.c

index 53d69d7d9ad480d28881517a7a7f80690239f575..eb8cafe801152028e5e2e2f9b6b1cc0ca5f02b52 100644 (file)
@@ -363,7 +363,7 @@ static int ipoib_cm_nonsrq_init_rx(struct net_device *dev, struct ib_cm_id *cm_i
        t = kmalloc(sizeof *t, GFP_KERNEL);
        if (!t) {
                ret = -ENOMEM;
-               goto err_free;
+               goto err_free_1;
        }
 
        ipoib_cm_init_rx_wr(dev, &t->wr, t->sge);
@@ -410,6 +410,8 @@ err_count:
 
 err_free:
        kfree(t);
+
+err_free_1:
        ipoib_cm_free_rx_ring(dev, rx->rx_ring);
 
        return ret;