aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>2012-06-29 05:48:49 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-06 13:58:38 -0400
commitb7283d5a044c010d5e68afccc0598846f254db7b (patch)
treeb6c77944d2d880bed6845e2f362c1f2c4a8857ce /drivers
parent3d97ff63f8997761f12c8fbe8082996c6eeaba1a (diff)
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 <alexander.shishkin@linux.intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Richard Zhao <richard.zhao@freescale.com> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/chipidea/udc.c3
1 files changed, 0 insertions, 3 deletions
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)
1648 struct device *dev = udc->dev; 1648 struct device *dev = udc->dev;
1649 int retval = 0; 1649 int retval = 0;
1650 1650
1651 if (!udc)
1652 return -EINVAL;
1653
1654 spin_lock_init(&udc->lock); 1651 spin_lock_init(&udc->lock);
1655 1652
1656 udc->gadget.ops = &usb_gadget_ops; 1653 udc->gadget.ops = &usb_gadget_ops;