Thread (1 message) 1 message, 1 author, 2012-06-26

Re: [PATCH v7 01/14] usb: chipidea: remove unneeded NULL check

From: Marek Vasut <hidden>
Date: 2012-06-26 21:51:33
Also in: linux-arm-kernel

Dear Richard Zhao,
From: Alexander Shishkin <alexander.shishkin-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>

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-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Reported-by: Dan Carpenter <redacted>
Acked-by: Felipe Balbi <redacted>
This seems correct, please add my:

Acked-by: Marek Vasut <redacted>
quoted hunk
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help