[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1368100001-14900-1-git-send-email-dp@opensource.wolfsonmicro.com>
Date: Thu, 9 May 2013 12:46:41 +0100
From: Dimitris Papastamos <dp@...nsource.wolfsonmicro.com>
To: Mark Brown <broonie@...nel.org>
Cc: linux-kernel@...r.kernel.org, patches@...nsource.wolfsonmicro.com
Subject: [PATCH] regmap: debugfs: Check return value of regmap_write()
Signed-off-by: Dimitris Papastamos <dp@...nsource.wolfsonmicro.com>
---
drivers/base/regmap/regmap-debugfs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index 6cd1b78a..ee81635 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -265,6 +265,7 @@ static ssize_t regmap_map_write_file(struct file *file,
char *start = buf;
unsigned long reg, value;
struct regmap *map = file->private_data;
+ int ret;
buf_size = min(count, (sizeof(buf)-1));
if (copy_from_user(buf, user_buf, buf_size))
@@ -282,7 +283,9 @@ static ssize_t regmap_map_write_file(struct file *file,
/* Userspace has been fiddling around behind the kernel's back */
add_taint(TAINT_USER, LOCKDEP_NOW_UNRELIABLE);
- regmap_write(map, reg, value);
+ ret = regmap_write(map, reg, value);
+ if (ret < 0)
+ return ret;
return buf_size;
}
#else
--
1.8.2.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists