]> Git Repo - linux.git/commitdiff
OPP: Properly propagate error along when failing to get icc_path
authorAndrew Halaney <[email protected]>
Mon, 26 Jun 2023 13:46:46 +0000 (08:46 -0500)
committerViresh Kumar <[email protected]>
Tue, 27 Jun 2023 02:05:14 +0000 (07:35 +0530)
fa155f4f8348 ("OPP: Use dev_err_probe() when failing to get icc_path")
failed to actually use the error it was trying to log:

    smatch warnings:
    drivers/opp/of.c:516 dev_pm_opp_of_find_icc_paths() warn: passing zero to 'dev_err_probe'

Make sure to use the right error and pass it along.

Fixes: fa155f4f8348 ("OPP: Use dev_err_probe() when failing to get icc_path")
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]/
Signed-off-by: Andrew Halaney <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
drivers/opp/of.c

index 1f0923cc1cd934d7d50b87ecee3a97275ae99ef9..ada4963c7cfae52643ec6d49ad2512be8e9c20e3 100644 (file)
@@ -513,7 +513,7 @@ int dev_pm_opp_of_find_icc_paths(struct device *dev,
        for (i = 0; i < num_paths; i++) {
                paths[i] = of_icc_get_by_index(dev, i);
                if (IS_ERR(paths[i])) {
-                       ret = dev_err_probe(dev, ret, "%s: Unable to get path%d\n", __func__, i);
+                       ret = dev_err_probe(dev, PTR_ERR(paths[i]), "%s: Unable to get path%d\n", __func__, i);
                        goto err;
                }
        }
This page took 0.057897 seconds and 4 git commands to generate.