linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: fsl: fix null pointer checking
@ 2020-10-16  4:33 Ran Wang
  2020-10-16  6:11 ` Peter Chen
  0 siblings, 1 reply; 2+ messages in thread
From: Ran Wang @ 2020-10-16  4:33 UTC (permalink / raw)
  To: Li Yang, Felipe Balbi, Greg Kroah-Hartman
  Cc: Peter Chen, linux-usb, linuxppc-dev, linux-kernel, Ran Wang

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

Fixes: 75eaa498c99e (“usb: gadget: Correct NULL pointer checking in fsl gadget”)
Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
 drivers/usb/gadget/udc/fsl_udc_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c
index de528e3..ad6ff9c 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);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] usb: gadget: fsl: fix null pointer checking
  2020-10-16  4:33 [PATCH] usb: gadget: fsl: fix null pointer checking Ran Wang
@ 2020-10-16  6:11 ` Peter Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Chen @ 2020-10-16  6:11 UTC (permalink / raw)
  To: Ran Wang, Leo Li, Felipe Balbi, Greg Kroah-Hartman
  Cc: linux-usb, linuxppc-dev, linux-kernel, Ran Wang

 
> 
> Fixes: 75eaa498c99e (“usb: gadget: Correct NULL pointer checking in fsl
> gadget”)
> Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
> ---
>  drivers/usb/gadget/udc/fsl_udc_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c
> b/drivers/usb/gadget/udc/fsl_udc_core.c
> index de528e3..ad6ff9c 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;
> 

Reviewed-by: Peter Chen <peter.chen@nxp.com>

Peter


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-16  6:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-16  4:33 [PATCH] usb: gadget: fsl: fix null pointer checking Ran Wang
2020-10-16  6:11 ` Peter Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).