提交 b7283d5a 编写于 作者: A Alexander Shishkin 提交者: Greg Kroah-Hartman

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: NAlexander Shishkin <alexander.shishkin@linux.intel.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NFelipe Balbi <balbi@ti.com>
Signed-off-by: NRichard Zhao <richard.zhao@freescale.com>
Acked-by: NMarek Vasut <marex@denx.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 3d97ff63
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册