All of lore.kernel.org
 help / color / mirror / Atom feed
* patch "usb: chipidea: fix static checker warning for NULL pointer" added to usb-linus
@ 2019-01-18  8:39 gregkh
  2019-01-21  5:29 ` Peter Chen
       [not found] ` <20190122155555.0AF57217D4@mail.kernel.org>
  0 siblings, 2 replies; 5+ messages in thread
From: gregkh @ 2019-01-18  8:39 UTC (permalink / raw)
  To: peter.chen, dan.carpenter, gregkh, stable


This is a note to let you know that I've just added the patch titled

    usb: chipidea: fix static checker warning for NULL pointer

to my usb git tree which can be found at
    git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.

The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.

If you have any questions about this process, please let me know.


From 8ff396fe56f5593640a8ce7223cac33a2cda619e Mon Sep 17 00:00:00 2001
From: Peter Chen <peter.chen@nxp.com>
Date: Thu, 17 Jan 2019 09:24:20 +0000
Subject: usb: chipidea: fix static checker warning for NULL pointer

During the static checker, "data->usbmisc_data" may be NULL.
Fix it by adding this pointer judgement before using.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/chipidea/ci_hdrc_imx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index e81de9ca8729..9b45aa422e69 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -316,7 +316,8 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
 	if (IS_ERR(data->usbmisc_data))
 		return PTR_ERR(data->usbmisc_data);
 
-	if (of_usb_get_phy_mode(dev->of_node) == USBPHY_INTERFACE_MODE_HSIC) {
+	if ((of_usb_get_phy_mode(dev->of_node) == USBPHY_INTERFACE_MODE_HSIC)
+		&& data->usbmisc_data) {
 		pdata.flags |= CI_HDRC_IMX_IS_HSIC;
 		data->usbmisc_data->hsic = 1;
 		data->pinctrl = devm_pinctrl_get(dev);
-- 
2.20.1



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

* RE: patch "usb: chipidea: fix static checker warning for NULL pointer" added to usb-linus
  2019-01-18  8:39 patch "usb: chipidea: fix static checker warning for NULL pointer" added to usb-linus gregkh
@ 2019-01-21  5:29 ` Peter Chen
  2019-01-21  7:21   ` gregkh
       [not found] ` <20190122155555.0AF57217D4@mail.kernel.org>
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Chen @ 2019-01-21  5:29 UTC (permalink / raw)
  To: gregkh, dan.carpenter, stable

 
> This is a note to let you know that I've just added the patch titled
> 
>     usb: chipidea: fix static checker warning for NULL pointer
> 
> to my usb git tree which can be found at
>     git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
> in the usb-linus branch.
> 
> The patch will show up in the next release of the linux-next tree (usually sometime
> within the next 24 hours during the week.)
> 
> The patch will hopefully also be merged in Linus's tree for the next -rc kernel
> release.
> 
> If you have any questions about this process, please let me know.
> 
> 

Hi Greg,

This patch does not need to go stable tree, this issue is introduced by v5.0-rc1.
Thanks.

Peter

> From 8ff396fe56f5593640a8ce7223cac33a2cda619e Mon Sep 17 00:00:00 2001
> From: Peter Chen <peter.chen@nxp.com>
> Date: Thu, 17 Jan 2019 09:24:20 +0000
> Subject: usb: chipidea: fix static checker warning for NULL pointer
> 
> During the static checker, "data->usbmisc_data" may be NULL.
> Fix it by adding this pointer judgement before using.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Peter Chen <peter.chen@nxp.com>
> Cc: stable <stable@vger.kernel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/usb/chipidea/ci_hdrc_imx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
> index e81de9ca8729..9b45aa422e69 100644
> --- a/drivers/usb/chipidea/ci_hdrc_imx.c
> +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
> @@ -316,7 +316,8 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
>  	if (IS_ERR(data->usbmisc_data))
>  		return PTR_ERR(data->usbmisc_data);
> 
> -	if (of_usb_get_phy_mode(dev->of_node) ==
> USBPHY_INTERFACE_MODE_HSIC) {
> +	if ((of_usb_get_phy_mode(dev->of_node) ==
> USBPHY_INTERFACE_MODE_HSIC)
> +		&& data->usbmisc_data) {
>  		pdata.flags |= CI_HDRC_IMX_IS_HSIC;
>  		data->usbmisc_data->hsic = 1;
>  		data->pinctrl = devm_pinctrl_get(dev);
> --
> 2.20.1
> 


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

* Re: patch "usb: chipidea: fix static checker warning for NULL pointer" added to usb-linus
  2019-01-21  5:29 ` Peter Chen
@ 2019-01-21  7:21   ` gregkh
  2019-01-21  7:26     ` Peter Chen
  0 siblings, 1 reply; 5+ messages in thread
From: gregkh @ 2019-01-21  7:21 UTC (permalink / raw)
  To: Peter Chen; +Cc: dan.carpenter, stable

On Mon, Jan 21, 2019 at 05:29:19AM +0000, Peter Chen wrote:
>  
> > This is a note to let you know that I've just added the patch titled
> > 
> >     usb: chipidea: fix static checker warning for NULL pointer
> > 
> > to my usb git tree which can be found at
> >     git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
> > in the usb-linus branch.
> > 
> > The patch will show up in the next release of the linux-next tree (usually sometime
> > within the next 24 hours during the week.)
> > 
> > The patch will hopefully also be merged in Linus's tree for the next -rc kernel
> > release.
> > 
> > If you have any questions about this process, please let me know.
> > 
> > 
> 
> Hi Greg,
> 
> This patch does not need to go stable tree, this issue is introduced by v5.0-rc1.

Next time please add a "Fixes:" tag so that it is more obvious :(

thanks,

greg k-h

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

* RE: patch "usb: chipidea: fix static checker warning for NULL pointer" added to usb-linus
  2019-01-21  7:21   ` gregkh
@ 2019-01-21  7:26     ` Peter Chen
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Chen @ 2019-01-21  7:26 UTC (permalink / raw)
  To: gregkh; +Cc: dan.carpenter, stable

 
> > >     usb: chipidea: fix static checker warning for NULL pointer
> > >
> > > to my usb git tree which can be found at
> > >     git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
> > > in the usb-linus branch.
> > >
> > > The patch will show up in the next release of the linux-next tree
> > > (usually sometime within the next 24 hours during the week.)
> > >
> > > The patch will hopefully also be merged in Linus's tree for the next
> > > -rc kernel release.
> > >
> > > If you have any questions about this process, please let me know.
> > >
> > >
> >
> > Hi Greg,
> >
> > This patch does not need to go stable tree, this issue is introduced by v5.0-rc1.
> 
> Next time please add a "Fixes:" tag so that it is more obvious :(
> 
> thanks,

Sorry, I will do it next time.

Peter

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

* Re: patch "usb: chipidea: fix static checker warning for NULL pointer" added to usb-linus
       [not found] ` <20190122155555.0AF57217D4@mail.kernel.org>
@ 2019-01-22 16:07   ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2019-01-22 16:07 UTC (permalink / raw)
  To: Sasha Levin; +Cc: Peter Chen, dan.carpenter, stable

On Tue, Jan 22, 2019 at 03:55:54PM +0000, Sasha Levin wrote:
> Hi,
> 
> [This is an automated email]
> 
> This commit has been processed because it contains a -stable tag.
> The stable tag indicates that it's relevant for the following trees: all
> 
> The bot has tested the following trees: v4.20.3, v4.19.16, v4.14.94, v4.9.151, v4.4.171, v3.18.132.
> 
> v4.20.3: Failed to apply! Possible dependencies:
>     7c8e8909417e ("usb: chipidea: imx: add HSIC support")
> 
> v4.19.16: Failed to apply! Possible dependencies:
>     7c8e8909417e ("usb: chipidea: imx: add HSIC support")
> 
> v4.14.94: Failed to apply! Possible dependencies:
>     7c8e8909417e ("usb: chipidea: imx: add HSIC support")
>     be9cae2479f4 ("usb: chipidea: imx: Fix ULPI on imx53")
> 
> v4.9.151: Failed to apply! Possible dependencies:
>     7c8e8909417e ("usb: chipidea: imx: add HSIC support")
>     be9cae2479f4 ("usb: chipidea: imx: Fix ULPI on imx53")
>     d13631bb15ce ("usb: chipidea: imx: configure imx for ULPI phy")
> 
> v4.4.171: Failed to apply! Possible dependencies:
>     7c8e8909417e ("usb: chipidea: imx: add HSIC support")
>     be9cae2479f4 ("usb: chipidea: imx: Fix ULPI on imx53")
>     d13631bb15ce ("usb: chipidea: imx: configure imx for ULPI phy")
>     d3d8425a21ed ("usb: chipidea: imx: avoid EPROBE_DEFER printed as error")
> 
> v3.18.132: Failed to apply! Possible dependencies:
>     19c1eac2685b ("usb: rename phy to usb_phy in OTG")
>     560400875d56 ("usb: chipidea: imx: using common platform flag directly")
>     69e28882dc7a ("usb: musb: gadget: do not rely on 'driver' argument")
>     7c8e8909417e ("usb: chipidea: imx: add HSIC support")
>     e14db48dfcf3 ("usb: chipidea: imx: add runtime power management support")
>     e47d92545c29 ("usb: move the OTG state from the USB PHY to the OTG structure")
>     ef44cb4226d1 ("usb: allow to supply the PHY in the drivers when using HCD")
> 
> 
> How should we proceed with this patch?

Heh, good catch checker!  turns out this patch is not for the stable
tree, I messed up :)

greg k-h

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

end of thread, other threads:[~2019-01-22 16:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-18  8:39 patch "usb: chipidea: fix static checker warning for NULL pointer" added to usb-linus gregkh
2019-01-21  5:29 ` Peter Chen
2019-01-21  7:21   ` gregkh
2019-01-21  7:26     ` Peter Chen
     [not found] ` <20190122155555.0AF57217D4@mail.kernel.org>
2019-01-22 16:07   ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.