Skip to content

Commit 7cf4dec

Browse files
Dan Carpentergregkh
authored andcommitted
RDMA/uverbs: Fix a NULL vs IS_ERR() bug
[ Upstream commit 463a3f6 ] The uapi_get_object() function returns error pointers, it never returns NULL. Fixes: 149d384 ("RDMA/uverbs: Add a method to introspect handles in a context") Link: https://lore.kernel.org/r/YJ6Got+U7lz+3n9a@mwanda Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent c62c907 commit 7cf4dec

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/infiniband/core/uverbs_std_types_device.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ static int UVERBS_HANDLER(UVERBS_METHOD_INFO_HANDLES)(
117117
return ret;
118118

119119
uapi_object = uapi_get_object(attrs->ufile->device->uapi, object_id);
120-
if (!uapi_object)
121-
return -EINVAL;
120+
if (IS_ERR(uapi_object))
121+
return PTR_ERR(uapi_object);
122122

123123
handles = gather_objects_handle(attrs->ufile, uapi_object, attrs,
124124
out_len, &total);

0 commit comments

Comments
 (0)