From: Colin Ian King Date: Fri, 20 Apr 2018 09:26:23 +0000 (+0100) Subject: regulator: wm8350: fix missing increment of loop index i X-Git-Tag: v5.15~8664^2~46 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f97a236801b29f6a8e2ba3957789c3932a908966;p=platform%2Fkernel%2Flinux-starfive.git regulator: wm8350: fix missing increment of loop index i It seems that the loop index i is not being incremented and hence potentially the while loop could spin forever. Fortunately with the data being used this does not appear to happen at the moment. Signed-off-by: Colin Ian King Acked-by: Charles Keepax Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index da9106b..8ad11b0 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c @@ -911,6 +911,7 @@ static unsigned int get_mode(int uA, const struct wm8350_dcdc_efficiency *eff) while (eff[i].uA_load_min != -1) { if (uA >= eff[i].uA_load_min && uA <= eff[i].uA_load_max) return eff[i].mode; + i++; } return REGULATOR_MODE_NORMAL; }