]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
video: stm32: dsi: fix unchecked return values
authorRaphael Gallais-Pou <rgallaispou@gmail.com>
Sun, 12 Apr 2026 19:07:58 +0000 (21:07 +0200)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Thu, 30 Apr 2026 06:01:11 +0000 (08:01 +0200)
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).

Link: https://lore.kernel.org/r/20260309212331.GF1388590@bill-the-cat/
Fixes: a6d047c0a86b ("video: stm32: remove all child of DSI bridge when its probe failed")
Signed-off-by: Raphael Gallais-Pou <rgallaispou@gmail.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
drivers/video/stm32/stm32_dsi.c

index 65a91f5cff7acd6752ce57d59725145b1e2bf3be..5c4d8d2aab515787cc58e95a04e3ccbba668db67 100644 (file)
@@ -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;
        }