Skip to contentSkip to conversation

video: stm32: dsi: fix unchecked return values

PATCH In review Raphael Gallais-Pou 2 participants 3 messages Apr 12 – Apr 30

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: stm32: dsi: fix unchecked return values

Fix the following errors yielded by Coverity Scan:

CID 644836: Error handling issues (CHECKED_RETURN)
Calling device_chld_unbind without checking return value (as is done elsewhere 6 out of 7 times)
CID 644834: Error handling issues (CHECKED_RETURN)
Calling device_chld_remove without checking return value (as is done elsewhere 4 out of 5 times).

Fixes a6d047c0a86b ("video: stm32: remove all child of DSI bridge when its probe failed")
---
 drivers/video/stm32/stm32_dsi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/video/stm32/stm32_dsi.c +5 -2
index 65a91f5cff7a..5c4d8d2aab51 100644
@@ -493,8 +493,11 @@ static int stm32_dsi_probe(struct udevice *dev)
 	    priv->hw_version != HWVER_131) {
 		dev_err(dev, "DSI version 0x%x not supported\n", priv->hw_version);
 		dev_dbg(dev, "remove and unbind all DSI child\n");
-		device_chld_remove(dev, NULL, DM_REMOVE_NORMAL);
-		device_chld_unbind(dev, NULL);
+		ret = device_chld_remove(dev, NULL, DM_REMOVE_NORMAL);
+		if (!ret)
+			ret = device_chld_unbind(dev, NULL);
+		if (ret)
+			dev_err(dev, "Unbinding from %s failed %d\n", dev->name, ret);
 		ret = -ENODEV;
 		goto err_clk;
 	}

---
base-commit: e2fa3e570f83ab0f9ce667ddaec9dc738bcf05b9
change-id: 20260412-master-8be67866e096

Best regards,

Signature · 1 line
Raphael Gallais-Pou <[email protected]>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 38 lines · Raphael Gallais-Pou

Fix the following errors yielded by Coverity Scan:

CID 644836: Error handling issues (CHECKED_RETURN)
Calling device_chld_unbind without checking return value (as is done elsewhere 6 out of 7 times)
CID 644834: Error handling issues (CHECKED_RETURN)
Calling device_chld_remove without checking return value (as is done elsewhere 4 out of 5 times).

Fixes a6d047c0a86b ("video: stm32: remove all child of DSI bridge when its probe failed")
---
 drivers/video/stm32/stm32_dsi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/video/stm32/stm32_dsi.c +5 -3
index 65a91f5cff7a..5c4d8d2aab51 100644
@@ -493,8 +493,11 @@ static int stm32_dsi_probe(struct udevice *dev)
 	    priv->hw_version != HWVER_131) {
 		dev_err(dev, "DSI version 0x%x not supported\n", priv->hw_version);
 		dev_dbg(dev, "remove and unbind all DSI child\n");
-		device_chld_remove(dev, NULL, DM_REMOVE_NORMAL);
-		device_chld_unbind(dev, NULL);
+		ret = device_chld_remove(dev, NULL, DM_REMOVE_NORMAL);
+		if (!ret)
+			ret = device_chld_unbind(dev, NULL);
+		if (ret)
+			dev_err(dev, "Unbinding from %s failed %d\n", dev->name, ret);
 		ret = -ENODEV;
 		goto err_clk;
 	}
 
---

base-commit: e2fa3e570f83ab0f9ce667ddaec9dc738bcf05b9
change-id: 20260412-master-8be67866e096

Quoted 4 lines

Best regards,

Signature · 1 line
Raphael Gallais-Pou <[email protected]>

Hi Raphael

Thanks
Patrice

#2 lore raw
Quoted 48 lines · Patrice CHOTARD
Quoted 38 lines · Raphael Gallais-Pou

Fix the following errors yielded by Coverity Scan:

CID 644836: Error handling issues (CHECKED_RETURN)
Calling device_chld_unbind without checking return value (as is done elsewhere 6 out of 7 times)
CID 644834: Error handling issues (CHECKED_RETURN)
Calling device_chld_remove without checking return value (as is done elsewhere 4 out of 5 times).

Fixes a6d047c0a86b ("video: stm32: remove all child of DSI bridge when its probe failed")
---
 drivers/video/stm32/stm32_dsi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/video/stm32/stm32_dsi.c +5 -3
index 65a91f5cff7a..5c4d8d2aab51 100644
@@ -493,8 +493,11 @@ static int stm32_dsi_probe(struct udevice *dev)
 	    priv->hw_version != HWVER_131) {
 		dev_err(dev, "DSI version 0x%x not supported\n", priv->hw_version);
 		dev_dbg(dev, "remove and unbind all DSI child\n");
-		device_chld_remove(dev, NULL, DM_REMOVE_NORMAL);
-		device_chld_unbind(dev, NULL);
+		ret = device_chld_remove(dev, NULL, DM_REMOVE_NORMAL);
+		if (!ret)
+			ret = device_chld_unbind(dev, NULL);
+		if (ret)
+			dev_err(dev, "Unbinding from %s failed %d\n", dev->name, ret);
 		ret = -ENODEV;
 		goto err_clk;
 	}
 
---

base-commit: e2fa3e570f83ab0f9ce667ddaec9dc738bcf05b9
change-id: 20260412-master-8be67866e096

Quoted 4 lines

Best regards,

Signature · 1 line
Raphael Gallais-Pou <[email protected]>

Hi Raphael

Quoted 4 lines

Thanks
Patrice

Applied to u-boot-stm32/master

Thanks
Patrice