linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: wm8350: fix missing increment of loop index i
@ 2018-04-20  9:26 Colin King
  2018-04-23  8:42 ` Charles Keepax
  2018-04-23 18:05 ` Applied "regulator: wm8350: fix missing increment of loop index i" to the regulator tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2018-04-20  9:26 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, patches; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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.

Fixes: da09155ac8d3 ("regulator: Add WM8350 regulator support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/regulator/wm8350-regulator.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c
index da9106bd2109..8ad11b074b49 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;
 }
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] regulator: wm8350: fix missing increment of loop index i
  2018-04-20  9:26 [PATCH] regulator: wm8350: fix missing increment of loop index i Colin King
@ 2018-04-23  8:42 ` Charles Keepax
  2018-04-23 18:05 ` Applied "regulator: wm8350: fix missing increment of loop index i" to the regulator tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2018-04-23  8:42 UTC (permalink / raw)
  To: Colin King
  Cc: Liam Girdwood, Mark Brown, patches, kernel-janitors, linux-kernel

On Fri, Apr 20, 2018 at 10:26:23AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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.
> 
> Fixes: da09155ac8d3 ("regulator: Add WM8350 regulator support")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Applied "regulator: wm8350: fix missing increment of loop index i" to the regulator tree
  2018-04-20  9:26 [PATCH] regulator: wm8350: fix missing increment of loop index i Colin King
  2018-04-23  8:42 ` Charles Keepax
@ 2018-04-23 18:05 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2018-04-23 18:05 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Charles Keepax, Mark Brown, Liam Girdwood, Mark Brown, patches,
	kernel-janitors, linux-kernel, linux-kernel

The patch

   regulator: wm8350: fix missing increment of loop index i

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From f97a236801b29f6a8e2ba3957789c3932a908966 Mon Sep 17 00:00:00 2001
From: Colin Ian King <colin.king@canonical.com>
Date: Fri, 20 Apr 2018 10:26:23 +0100
Subject: [PATCH] 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 <colin.king@canonical.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/wm8350-regulator.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c
index da9106bd2109..8ad11b074b49 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;
 }
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-23 18:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-20  9:26 [PATCH] regulator: wm8350: fix missing increment of loop index i Colin King
2018-04-23  8:42 ` Charles Keepax
2018-04-23 18:05 ` Applied "regulator: wm8350: fix missing increment of loop index i" to the regulator tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).