From: Mark Brown <broonie@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Stefan Wahren <stefan.wahren@i2se.com>, Mark Brown <broonie@kernel.org>
Subject: [PATCH] regulator: core: Don't corrupt display when printing uV offsets
Date: Tue, 9 Jun 2015 19:54:43 +0100 [thread overview]
Message-ID: <1433876083-30046-1-git-send-email-broonie@kernel.org> (raw)
We weren't taking into account the already used buffer when telling
sprintf() where to print to.
Reported-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/regulator/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index f6989485c382..5ec894e9f3e4 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -801,7 +801,7 @@ static void print_constraints(struct regulator_dev *rdev)
}
if (constraints->uV_offset)
- count += sprintf(buf, "%dmV offset ",
+ count += sprintf(buf + count, "%dmV offset ",
constraints->uV_offset / 1000);
if (constraints->min_uA && constraints->max_uA) {
--
2.1.4
reply other threads:[~2015-06-09 18:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1433876083-30046-1-git-send-email-broonie@kernel.org \
--to=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stefan.wahren@i2se.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®