diff options
Diffstat (limited to 'drivers/base/regmap/regmap-debugfs.c')
-rw-r--r-- | drivers/base/regmap/regmap-debugfs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index 23b701f5fd2f..975719bc3450 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, | |||
265 | char *start = buf; | 265 | char *start = buf; |
266 | unsigned long reg, value; | 266 | unsigned long reg, value; |
267 | struct regmap *map = file->private_data; | 267 | struct regmap *map = file->private_data; |
268 | int ret; | ||
268 | 269 | ||
269 | buf_size = min(count, (sizeof(buf)-1)); | 270 | buf_size = min(count, (sizeof(buf)-1)); |
270 | if (copy_from_user(buf, user_buf, buf_size)) | 271 | if (copy_from_user(buf, user_buf, buf_size)) |
@@ -282,7 +283,9 @@ static ssize_t regmap_map_write_file(struct file *file, | |||
282 | /* Userspace has been fiddling around behind the kernel's back */ | 283 | /* Userspace has been fiddling around behind the kernel's back */ |
283 | add_taint(TAINT_USER, LOCKDEP_NOW_UNRELIABLE); | 284 | add_taint(TAINT_USER, LOCKDEP_NOW_UNRELIABLE); |
284 | 285 | ||
285 | regmap_write(map, reg, value); | 286 | ret = regmap_write(map, reg, value); |
287 | if (ret < 0) | ||
288 | return ret; | ||
286 | return buf_size; | 289 | return buf_size; |
287 | } | 290 | } |
288 | #else | 291 | #else |