usb: gadget: lpc32xxx_udc: Fix NULL dereference
authorPeter Chen <peter.chen@freescale.com>
Wed, 11 Mar 2015 02:07:47 +0000 (10:07 +0800)
committerFelipe Balbi <balbi@ti.com>
Wed, 11 Mar 2015 19:59:10 +0000 (14:59 -0500)
commit005a64307d5d3ef895e7821df4cad7739bab392e
treeecb7e5d25e488216143d204795927ddb6a327515
parent72a472d2f912292457d6e3579df342c1138f26d5
usb: gadget: lpc32xxx_udc: Fix NULL dereference

udc is then checked for NULL, if NULL, it is then dereferenced as
udc->dev, it is found using Coccinelle.

We simplify the code to fix this problem, and we delete some conditions
at if {} which will never be met.

Reported-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Reported-by : Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc/lpc32xx_udc.c