diff options
author | Leon Romanovsky <leonro@mellanox.com> | 2020-09-07 15:09:19 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2020-09-09 14:14:29 -0300 |
commit | d0c45c8556e57342d44c9548763609ffcc4e3866 (patch) | |
tree | 3ed7b1bfeaf7b7be35e70d91872a7eedde54cf7e /drivers/infiniband/core/verbs.c | |
parent | 43d781b9fa562f0c6e50f62c870fbfeb9dc85213 (diff) | |
download | linux-d0c45c8556e57342d44c9548763609ffcc4e3866.tar.gz linux-d0c45c8556e57342d44c9548763609ffcc4e3866.tar.bz2 linux-d0c45c8556e57342d44c9548763609ffcc4e3866.zip |
RDMA: Change XRCD destroy return value
Update XRCD destroy flow to allow command failure.
Fixes: 28ad5f65c314 ("RDMA: Move XRCD to be under ib_core responsibility")
Link: https://lore.kernel.org/r/20200907120921.476363-8-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/core/verbs.c')
-rw-r--r-- | drivers/infiniband/core/verbs.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 93503f10bcbb..117265616cd0 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -2345,13 +2345,17 @@ EXPORT_SYMBOL(ib_alloc_xrcd_user); */ int ib_dealloc_xrcd_user(struct ib_xrcd *xrcd, struct ib_udata *udata) { + int ret; + if (atomic_read(&xrcd->usecnt)) return -EBUSY; WARN_ON(!xa_empty(&xrcd->tgt_qps)); - xrcd->device->ops.dealloc_xrcd(xrcd, udata); + ret = xrcd->device->ops.dealloc_xrcd(xrcd, udata); + if (ret) + return ret; kfree(xrcd); - return 0; + return ret; } EXPORT_SYMBOL(ib_dealloc_xrcd_user); |