2013-05-09 11:46:45

by Dimitris Papastamos

[permalink] [raw]
Subject: [PATCH] regmap: debugfs: Check return value of regmap_write()

Signed-off-by: Dimitris Papastamos <[email protected]>
---
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


2013-05-09 13:33:36

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] regmap: debugfs: Check return value of regmap_write()

On Thu, May 09, 2013 at 12:46:41PM +0100, Dimitris Papastamos wrote:
> Signed-off-by: Dimitris Papastamos <[email protected]>

Applied, thanks.


Attachments:
(No filename) (157.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments