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

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

 



On Wed, May 23, 2018 at 03:16:33PM +0300, Leon Romanovsky wrote:
> 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
> > +++ 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);

Oh interesting.. Please fix

https://patchwork.kernel.org/patch/10401247/

Also

Jason

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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