usb: gadget: fsl: fix null pointer checking

fsl_ep_fifo_status() should return error if _ep->desc is null.

Fixes: 75eaa498c9 (“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>
This commit is contained in:
Ran Wang 2020-10-16 12:33:26 +08:00 committed by Felipe Balbi
parent 0d66e04875
commit 48e7bbbbb2
1 changed files with 1 additions and 1 deletions

View File

@ -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);