Skip to content

Commit

Permalink
usb: chipidea: remove unneeded NULL check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Shishkin authored and Greg Kroah-Hartman committed Jul 6, 2012
1 parent 3d97ff6 commit b7283d5
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/usb/chipidea/udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b7283d5

Please sign in to comment.