LinuxPPC-Dev Archive on lore.kernel.org
 help / color / 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	[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, back to index

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

LinuxPPC-Dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linuxppc-dev/0 linuxppc-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linuxppc-dev linuxppc-dev/ https://lore.kernel.org/linuxppc-dev \
		linuxppc-dev@lists.ozlabs.org linuxppc-dev@ozlabs.org
	public-inbox-index linuxppc-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.ozlabs.lists.linuxppc-dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git