diff options
author | Vasiliy Kulikov <segoon@openwall.com> | 2011-01-17 13:08:49 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-01-21 12:35:14 -0800 |
commit | 01ebd764dab26b3064b0c73ddcf726dd4b41485a (patch) | |
tree | 8a82814492fb9e372187f16234b62e8839399496 | |
parent | 2f644ccfc5a3195290d12b8eedf18a37bba27d98 (diff) |
staging: cs5535_gpio: check put_user() return code
put_user() may fail, if so return -EFAULT.
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/cs5535_gpio/cs5535_gpio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/cs5535_gpio/cs5535_gpio.c b/drivers/staging/cs5535_gpio/cs5535_gpio.c index 0cf1e5fad9ab..b25f9d103b3b 100644 --- a/drivers/staging/cs5535_gpio/cs5535_gpio.c +++ b/drivers/staging/cs5535_gpio/cs5535_gpio.c @@ -146,7 +146,8 @@ static ssize_t cs5535_gpio_read(struct file *file, char __user *buf, /* add a line-feed if there is room */ if ((i == ARRAY_SIZE(rm)) && (count < len)) { - put_user('\n', buf + count); + if (put_user('\n', buf + count)) + return -EFAULT; count++; } |