RDMA/efa: Remove umem check on dereg MR flow
authorGal Pressman <galpress@amazon.com>
Mon, 26 Aug 2019 11:53:49 +0000 (14:53 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 27 Aug 2019 16:01:14 +0000 (13:01 -0300)
EFA driver is not a kverbs provider, the check for MR umem is redundant.

Link: https://lore.kernel.org/r/20190826115350.21718-2-galpress@amazon.com
Reviewed-by: Firas JahJah <firasj@amazon.com>
Reviewed-by: Yossi Leybovich <sleybo@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/efa/efa_verbs.c

index 70851bd..1e23c62 100644 (file)
@@ -1500,14 +1500,12 @@ int efa_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata)
 
        ibdev_dbg(&dev->ibdev, "Deregister mr[%d]\n", ibmr->lkey);
 
-       if (mr->umem) {
-               params.l_key = mr->ibmr.lkey;
-               err = efa_com_dereg_mr(&dev->edev, &params);
-               if (err)
-                       return err;
-       }
-       ib_umem_release(mr->umem);
+       params.l_key = mr->ibmr.lkey;
+       err = efa_com_dereg_mr(&dev->edev, &params);
+       if (err)
+               return err;
 
+       ib_umem_release(mr->umem);
        kfree(mr);
 
        return 0;