From c456b89a93664d6ff0aba1ced9dd88b88df2505a Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 9 Jun 2015 19:54:10 +0100 Subject: [PATCH] regulator: core: Don't corrupt display when printing uV offsets We weren't taking into account the already used buffer when telling sprintf() where to print to. Reported-by: Stefan Wahren Signed-off-by: Mark Brown --- 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 443eaab..9afa3af 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.7.4