Commit f4602cbb authored by Jason Gunthorpe's avatar Jason Gunthorpe

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: be934cca ("IB/uverbs: Add device memory registration ioctl support")
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
parent 30bf066c
......@@ -411,13 +411,13 @@ static inline int uverbs_attr_get_enum_id(const struct uverbs_attr_bundle *attrs
static inline void *uverbs_attr_get_obj(const struct uverbs_attr_bundle *attrs_bundle,
u16 idx)
{
struct ib_uobject *uobj =
uverbs_attr_get(attrs_bundle, idx)->obj_attr.uobject;
const struct uverbs_attr *attr;
if (IS_ERR(uobj))
return uobj;
attr = uverbs_attr_get(attrs_bundle, idx);
if (IS_ERR(attr))
return ERR_CAST(attr);
return uobj->object;
return attr->obj_attr.uobject->object;
}
static inline int uverbs_copy_to(const struct uverbs_attr_bundle *attrs_bundle,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment