2020-04-23 14:24:10

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: [PATCH] IB/rdmavt: return proper error code

On Thu, Apr 23, 2020 at 01:04:34PM +0100, Sudip Mukherjee wrote:
> The function rvt_create_mmap_info() can return either NULL or an error
> in ERR_PTR(). Check properly for both the error type and return the
> error code accordingly.

Please fix rvt_create_mmap_info to always return ERR_PTR, never null
on failure.

Thanks,
Jason


2020-04-24 12:30:39

by Dennis Dalessandro

[permalink] [raw]
Subject: Re: [PATCH] IB/rdmavt: return proper error code

On 4/23/2020 10:09 AM, Jason Gunthorpe wrote:
> On Thu, Apr 23, 2020 at 01:04:34PM +0100, Sudip Mukherjee wrote:
>> The function rvt_create_mmap_info() can return either NULL or an error
>> in ERR_PTR(). Check properly for both the error type and return the
>> error code accordingly.
>
> Please fix rvt_create_mmap_info to always return ERR_PTR, never null
> on failure.
>
> Thanks,
> Jason
>

Yes, that is a better approach.

-Denny

2020-04-24 13:52:18

by Marciniszyn, Mike

[permalink] [raw]
Subject: RE: [PATCH] IB/rdmavt: return proper error code

> Subject: Re: [PATCH] IB/rdmavt: return proper error code
>
> On Thu, Apr 23, 2020 at 01:04:34PM +0100, Sudip Mukherjee wrote:
> > The function rvt_create_mmap_info() can return either NULL or an error
> > in ERR_PTR(). Check properly for both the error type and return the
> > error code accordingly.
>
> Please fix rvt_create_mmap_info to always return ERR_PTR, never null
> on failure.
>
> Thanks,
> Jason

I agree on the ERR_PTR return, but the patch is incomplete.

The original patch:

Fixes: ff23dfa13457 ("IB: Pass only ib_udata in function prototypes")

Broke all the call sites: cq.c, srq.c, and qp.c.

Mike


2020-04-24 14:07:05

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: [PATCH] IB/rdmavt: return proper error code

On Fri, Apr 24, 2020 at 01:50:22PM +0000, Marciniszyn, Mike wrote:
> > Subject: Re: [PATCH] IB/rdmavt: return proper error code
> >
> > On Thu, Apr 23, 2020 at 01:04:34PM +0100, Sudip Mukherjee wrote:
> > > The function rvt_create_mmap_info() can return either NULL or an error
> > > in ERR_PTR(). Check properly for both the error type and return the
> > > error code accordingly.
> >
> > Please fix rvt_create_mmap_info to always return ERR_PTR, never null
> > on failure.
> >
> > Thanks,
> > Jason
>
> I agree on the ERR_PTR return, but the patch is incomplete.
>
> The original patch:
>
> Fixes: ff23dfa13457 ("IB: Pass only ib_udata in function prototypes")
>
> Broke all the call sites: cq.c, srq.c, and qp.c.

Sure looks like it, someone make a patch..

Jason