Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964870AbcLUQVM (ORCPT ); Wed, 21 Dec 2016 11:21:12 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34581 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758321AbcLUQUG (ORCPT ); Wed, 21 Dec 2016 11:20:06 -0500 Date: Wed, 21 Dec 2016 16:11:44 +0000 From: Sudip Mukherjee To: Shuah Khan Cc: Shuah Khan , Valentina Manea , Greg Kroah-Hartman , LKML , linux-usb@vger.kernel.org, Shuah Khan Subject: Re: [PATCH] usbip: vudc: check for NULL before use Message-ID: <20161221160820.GA16744@sudip-tp> References: <1482101091-3969-1-git-send-email-sudipm.mukherjee@gmail.com> <20161221133315.GA13517@sudip-tp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1572 Lines: 42 On Wed, Dec 21, 2016 at 07:38:21AM -0700, Shuah Khan wrote: > Hi Sudip, > > On Wed, Dec 21, 2016 at 6:33 AM, Sudip Mukherjee > wrote: > > 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 > >> > --- > >> > 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. > > This is for vep_dequeue() - Are you sure both linux-next and Linus's tree show > the following: This is for vep_set_halt_and_wedge(). I do not have any idea why the patch says its vep_dequeue(). I tried generating the patch again and it still shows as vep_dequeue(). But the line number 388 is correct and if you try to apply, it applies correctly. regards sudip