From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758852AbcLUNeD (ORCPT ); Wed, 21 Dec 2016 08:34:03 -0500 Received: from mail-wj0-f196.google.com ([209.85.210.196]:36220 "EHLO mail-wj0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755028AbcLUNeA (ORCPT ); Wed, 21 Dec 2016 08:34:00 -0500 Date: Wed, 21 Dec 2016 13:33:15 +0000 From: Sudip Mukherjee To: Shuah Khan Cc: Valentina Manea , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Shuah Khan Subject: Re: [PATCH] usbip: vudc: check for NULL before use Message-ID: <20161221133315.GA13517@sudip-tp> References: <1482101091-3969-1-git-send-email-sudipm.mukherjee@gmail.com> 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 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. regards sudip