RDMA/uverbs: Fix a NULL vs IS_ERR() bug
[ Upstream commit 463a3f66473b58d71428a1c3ce69ea52c05440e5 ]
The uapi_get_object() function returns error pointers, it never returns
NULL.
Fixes: 149d3845f4
("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>
This commit is contained in:
parent
6fa78a6b9a
commit
88128a5054
|
@ -110,8 +110,8 @@ static int UVERBS_HANDLER(UVERBS_METHOD_INFO_HANDLES)(
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
uapi_object = uapi_get_object(attrs->ufile->device->uapi, object_id);
|
uapi_object = uapi_get_object(attrs->ufile->device->uapi, object_id);
|
||||||
if (!uapi_object)
|
if (IS_ERR(uapi_object))
|
||||||
return -EINVAL;
|
return PTR_ERR(uapi_object);
|
||||||
|
|
||||||
handles = gather_objects_handle(attrs->ufile, uapi_object, attrs,
|
handles = gather_objects_handle(attrs->ufile, uapi_object, attrs,
|
||||||
out_len, &total);
|
out_len, &total);
|
||||||
|
|
Loading…
Reference in New Issue