From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Subject: Re: [PATCH v7 01/14] usb: chipidea: remove unneeded NULL check Date: Tue, 26 Jun 2012 23:51:33 +0200 Message-ID: <201206262351.34006.marex@denx.de> References: <1340607391-16380-1-git-send-email-richard.zhao@freescale.com> <1340607391-16380-2-git-send-email-richard.zhao@freescale.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1340607391-16380-2-git-send-email-richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org> Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Richard Zhao Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, B29397-KZfg59tc24xl57MIdRCFDg@public.gmane.org, B20596-KZfg59tc24xl57MIdRCFDg@public.gmane.org, shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, alexander.shishkin-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org, dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org, linuxzsc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, balbi-l0cyMroinI0@public.gmane.org List-Id: devicetree@vger.kernel.org Dear Richard Zhao, > From: Alexander Shishkin > > As reported by Dan Carpenter, there is a NULL check in udc_start() that > follows a dereference of the pointer that's being checked. However, at > that point udc pointer shouldn't ever be NULL and if it is, the dereference > should cause an oops. > > Signed-off-by: Alexander Shishkin > Reported-by: Dan Carpenter > Acked-by: Felipe Balbi This seems correct, please add my: Acked-by: Marek Vasut > --- > drivers/usb/chipidea/udc.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c > index 51f9694..cdb9212 100644 > --- a/drivers/usb/chipidea/udc.c > +++ b/drivers/usb/chipidea/udc.c > @@ -1647,9 +1647,6 @@ static int udc_start(struct ci13xxx *udc) > struct device *dev = udc->dev; > int retval = 0; > > - if (!udc) > - return -EINVAL; > - > spin_lock_init(&udc->lock); > > udc->gadget.ops = &usb_gadget_ops; Best regards, Marek Vasut -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html