lkml.org 
[lkml]   [2016]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] usbip: vudc: check for NULL before use
On Tue, Dec 20, 2016 at 07:31:44AM -0700, Shuah Khan wrote:
> On 12/18/2016 03:44 PM, Sudip Mukherjee wrote:
> > to_vep() is doing a container_of() on _ep. It is better to do the NULL
> > check first and then use it.
> >
> > Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
> > ---
> > drivers/usb/usbip/vudc_dev.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/usbip/vudc_dev.c b/drivers/usb/usbip/vudc_dev.c
> > index 968471b..32ea604 100644
> > --- a/drivers/usb/usbip/vudc_dev.c
> > +++ b/drivers/usb/usbip/vudc_dev.c
> > @@ -388,10 +388,10 @@ static int vep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
> > unsigned long flags;
> > int ret = 0;
> >
> > - ep = to_vep(_ep);
> > if (!_ep)
> > return -EINVAL;
>
> Hmm. Linus's latest checks _ep and _req. Are you sure you are working
> with the latest tree?

I checked with next-20161221 and its still there.

regards
sudip

\
 
 \ /
  Last update: 2016-12-21 14:34    [W:0.359 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site