Skip to content

Commit 3530167

Browse files
krzkandersson
authored andcommitted
soc: qcom: icc-bwmon: fix incorrect error code passed to dev_err_probe()
Pass to dev_err_probe() PTR_ERR from actual dev_pm_opp_find_bw_floor() call which failed, instead of previous ret which at this point is 0. Failure of dev_pm_opp_find_bw_floor() would result in prematurely ending the probe with success. Fixes smatch warnings: drivers/soc/qcom/icc-bwmon.c:776 bwmon_probe() warn: passing zero to 'dev_err_probe' drivers/soc/qcom/icc-bwmon.c:781 bwmon_probe() warn: passing zero to 'dev_err_probe' Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected]/ Cc: <[email protected]> Fixes: b9c2ae6 ("soc: qcom: icc-bwmon: Add bandwidth monitoring driver") Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ac9a786 commit 3530167

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/soc/qcom/icc-bwmon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,12 +773,12 @@ static int bwmon_probe(struct platform_device *pdev)
773773
bwmon->max_bw_kbps = UINT_MAX;
774774
opp = dev_pm_opp_find_bw_floor(dev, &bwmon->max_bw_kbps, 0);
775775
if (IS_ERR(opp))
776-
return dev_err_probe(dev, ret, "failed to find max peak bandwidth\n");
776+
return dev_err_probe(dev, PTR_ERR(opp), "failed to find max peak bandwidth\n");
777777

778778
bwmon->min_bw_kbps = 0;
779779
opp = dev_pm_opp_find_bw_ceil(dev, &bwmon->min_bw_kbps, 0);
780780
if (IS_ERR(opp))
781-
return dev_err_probe(dev, ret, "failed to find min peak bandwidth\n");
781+
return dev_err_probe(dev, PTR_ERR(opp), "failed to find min peak bandwidth\n");
782782

783783
bwmon->dev = dev;
784784

0 commit comments

Comments
 (0)