From: Zhu Yanjun Date: Fri, 10 Feb 2017 06:48:42 +0000 (-0500) Subject: IB/ipoib: remove the unnecessary memory free X-Git-Tag: v4.11-rc1~103^2~17 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c5e8f57b0b560b9cc9ea9166975858d023f81030;p=karo-tx-linux.git IB/ipoib: remove the unnecessary memory free In the function ipoib_cm_nonsrq_init_rx, the memory is not allocated successfully. It is not necessary to free it. CC: Joe Jin CC: Junxiao Bi Signed-off-by: Zhu Yanjun Reviewed-by: Leon Romanovsky Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 53d69d7d9ad4..eb8cafe80115 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c @@ -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;