diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-11 05:55:20 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-25 23:21:22 +0300 |
commit | 2c96eb7d62de5048aa08e9ee4fbb607f29e2638c (patch) | |
tree | 3c73802d3c6661c6828c2f9fe881e4710875cf97 /drivers/infiniband/core/rdma_core.c | |
parent | e951747a087a8655f467833bb367ebf53d57527c (diff) | |
download | linux-2c96eb7d62de5048aa08e9ee4fbb607f29e2638c.tar.xz |
IB/uverbs: Always propagate errors from rdma_alloc_commit_uobject()
The ioctl framework already does this correctly, but the write path did
not. This is trivially fixed by simply using a standard pattern to return
uobj_alloc_commit() as the last statement in every function.
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/rdma_core.c')
-rw-r--r-- | drivers/infiniband/core/rdma_core.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/core/rdma_core.c b/drivers/infiniband/core/rdma_core.c index eeed6374134c..2aab8cd2ca6b 100644 --- a/drivers/infiniband/core/rdma_core.c +++ b/drivers/infiniband/core/rdma_core.c @@ -532,9 +532,10 @@ static void alloc_commit_fd_uobject(struct ib_uobject *uobj) /* * In all cases rdma_alloc_commit_uobject() consumes the kref to uobj and the - * caller can no longer assume uobj is valid. + * caller can no longer assume uobj is valid. If this function fails it + * destroys the uboject, including the attached HW object. */ -int rdma_alloc_commit_uobject(struct ib_uobject *uobj) +int __must_check rdma_alloc_commit_uobject(struct ib_uobject *uobj) { struct ib_uverbs_file *ufile = uobj->ufile; |