summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorRan Wang <ran.wang_1@nxp.com>2020-10-16 12:33:26 +0800
committerFelipe Balbi <balbi@kernel.org>2020-10-27 10:57:24 +0200
commit48e7bbbbb261b007fe78aa14ae62df01d236497e (patch)
tree0019819dc398cf24334f0e691cd2c7d3f753d31a /drivers/usb
parent0d66e04875c5aae876cf3d4f4be7978fa2b00523 (diff)
usb: gadget: fsl: fix null pointer checking
fsl_ep_fifo_status() should return error if _ep->desc is null. Fixes: 75eaa498c99e (“usb: gadget: Correct NULL pointer checking in fsl gadget”) Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Ran Wang <ran.wang_1@nxp.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/udc/fsl_udc_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c
index de528e3b0662..ad6ff9c4188e 100644
--- a/drivers/usb/gadget/udc/fsl_udc_core.c
+++ b/drivers/usb/gadget/udc/fsl_udc_core.c
@@ -1051,7 +1051,7 @@ static int fsl_ep_fifo_status(struct usb_ep *_ep)
u32 bitmask;
struct ep_queue_head *qh;
- if (!_ep || _ep->desc || !(_ep->desc->bEndpointAddress&0xF))
+ if (!_ep || !_ep->desc || !(_ep->desc->bEndpointAddress&0xF))
return -ENODEV;
ep = container_of(_ep, struct fsl_ep, ep);