RDMA: Fix goto target to release the allocated memory
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Tue, 10 Sep 2019 22:21:19 +0000 (17:21 -0500)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 13 Sep 2019 19:55:55 +0000 (16:55 -0300)
In bnxt_re_create_srq(), when ib_copy_to_udata() fails allocated memory
should be released by goto fail.

Fixes: 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters")
Link: https://lore.kernel.org/r/20190910222120.16517-1-navid.emamdoost@gmail.com
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/bnxt_re/ib_verbs.c

index f9e97d0cc459ced27d7f4191374a6fa759f52f05..b4149dc9e824635c58f4f49531dd3e207da701ea 100644 (file)
@@ -1398,7 +1398,7 @@ int bnxt_re_create_srq(struct ib_srq *ib_srq,
                        dev_err(rdev_to_dev(rdev), "SRQ copy to udata failed!");
                        bnxt_qplib_destroy_srq(&rdev->qplib_res,
                                               &srq->qplib_srq);
-                       goto exit;
+                       goto fail;
                }
        }
        if (nq)