Re: [PATCH for-rc] IB/uverbs: Fix uverbs_attr_get_obj

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 22, 2018 at 03:56:51PM -0600, Jason Gunthorpe wrote:
> The err pointer comes from uverbs_attr_get, not from the uobject member,
> which does not store an ERR_PTR.
>
> Fixes: be934cca9e98 ("IB/uverbs: Add device memory registration ioctl support")
> Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
> ---
>  include/rdma/uverbs_ioctl.h | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h
> index 4a4201d997a73c..c9398acc63d7bd 100644
> --- a/include/rdma/uverbs_ioctl.h
> +++ b/include/rdma/uverbs_ioctl.h
> @@ -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 (void *)attr;

1. return ERR_CAST(attr);
2. Extra space in title between "uverbs" and "Fix".

Thanks,
Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux