Skip to content

Commit

Permalink
usb: gadget: fsl: fix null pointer checking
Browse files Browse the repository at this point in the history
fsl_ep_fifo_status() should return error if _ep->desc is null.

Fixes: 75eaa49 (“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>
  • Loading branch information
Ran Wang authored and Felipe Balbi committed Oct 27, 2020
1 parent 0d66e04 commit 48e7bbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/udc/fsl_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 48e7bbb

Please sign in to comment.