mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: core: Don't corrupt display when printing uV offsets
@ 2015-06-09 18:54 Mark Brown
  0 siblings, 0 replies; only message in thread
From: Mark Brown @ 2015-06-09 18:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: Stefan Wahren, Mark Brown

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-06-09 18:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-09 18:54 [PATCH] regulator: core: Don't corrupt display when printing uV offsets Mark Brown

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®