Skip to content

Commit f4602cb

Browse files
committed
IB/uverbs: Fix uverbs_attr_get_obj
The err pointer comes from uverbs_attr_get, not from the uobject member, which does not store an ERR_PTR. Fixes: be934cc ("IB/uverbs: Add device memory registration ioctl support") Signed-off-by: Jason Gunthorpe <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]>
1 parent 30bf066 commit f4602cb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

include/rdma/uverbs_ioctl.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,13 @@ static inline int uverbs_attr_get_enum_id(const struct uverbs_attr_bundle *attrs
411411
static inline void *uverbs_attr_get_obj(const struct uverbs_attr_bundle *attrs_bundle,
412412
u16 idx)
413413
{
414-
struct ib_uobject *uobj =
415-
uverbs_attr_get(attrs_bundle, idx)->obj_attr.uobject;
414+
const struct uverbs_attr *attr;
416415

417-
if (IS_ERR(uobj))
418-
return uobj;
416+
attr = uverbs_attr_get(attrs_bundle, idx);
417+
if (IS_ERR(attr))
418+
return ERR_CAST(attr);
419419

420-
return uobj->object;
420+
return attr->obj_attr.uobject->object;
421421
}
422422

423423
static inline int uverbs_copy_to(const struct uverbs_attr_bundle *attrs_bundle,

0 commit comments

Comments
 (0)