All of lore.kernel.org
 help / color / mirror / Atom feed
From: Colin King <colin.king@canonical.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	patches@opensource.cirrus.com
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] regulator: wm8350: fix missing increment of loop index i
Date: Fri, 20 Apr 2018 10:26:23 +0100	[thread overview]
Message-ID: <20180420092623.1327-1-colin.king@canonical.com> (raw)

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

WARNING: multiple messages have this Message-ID (diff)
From: Colin King <colin.king@canonical.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	patches@opensource.cirrus.com
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] regulator: wm8350: fix missing increment of loop index i
Date: Fri, 20 Apr 2018 09:26:23 +0000	[thread overview]
Message-ID: <20180420092623.1327-1-colin.king@canonical.com> (raw)

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


             reply	other threads:[~2018-04-20  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20  9:26 Colin King [this message]
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  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
2018-04-23 18:05   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180420092623.1327-1-colin.king@canonical.com \
    --to=colin.king@canonical.com \
    --cc=broonie@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.