Skip to contentSkip to conversation

patch "usb: chipidea: fix static checker warning for NULL pointer" added to usb-linus

PATCH [email protected] 2 participants 5 messages Jan 18, 2019 – Jan 22, 2019 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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 <[email protected]>
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.

---
 drivers/usb/chipidea/ci_hdrc_imx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/chipidea/ci_hdrc_imx.c +2 -1
index e81de9ca8729..9b45aa422e69 100644
@@ -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);
Signature · 1 line
2.20.1
#1 lore raw
Quoted 9 lines

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.

Quoted 9 lines

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

Quoted 35 lines

From 8ff396fe56f5593640a8ce7223cac33a2cda619e Mon Sep 17 00:00:00 2001
From: Peter Chen <[email protected]>
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.

---
 drivers/usb/chipidea/ci_hdrc_imx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/chipidea/ci_hdrc_imx.c +2 -1
index e81de9ca8729..9b45aa422e69 100644
@@ -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;
drivers/usb/chipidea/ci_hdrc_imx.c +0 -1
 		data->usbmisc_data->hsic = 1;
 		data->pinctrl = devm_pinctrl_get(dev);
--

2.20.1

author maintainer
#2 lore raw
Quoted 15 lines · Peter Chen
Quoted 15 lines

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.

Quoted 7 lines
Quoted 3 lines

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

#3 lore raw
Quoted 17 lines
Quoted 17 lines
Quoted 16 lines

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.

Quoted 7 lines
Quoted 3 lines

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

author maintainer
#5 lore raw
Quoted 40 lines · Sasha Levin

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")

Quoted 1 line

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