From b7283d5a044c010d5e68afccc0598846f254db7b Mon Sep 17 00:00:00 2001 From: Alexander Shishkin Date: Fri, 29 Jun 2012 17:48:49 +0800 Subject: usb: chipidea: remove unneeded NULL check 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 Signed-off-by: Richard Zhao Acked-by: Marek Vasut Signed-off-by: Greg Kroah-Hartman --- drivers/usb/chipidea/udc.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/usb/chipidea/udc.c') diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 4688ab71bd27..80e71021f186 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -1648,9 +1648,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; -- cgit v1.2.1