gpio: mockup: return -EFAULT if copy_from_user() fails
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 14 Feb 2017 23:02:06 +0000 (02:02 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 6 Mar 2017 13:35:21 +0000 (14:35 +0100)
commitfa6256db033067b57318decdc1c583512a1f8f68
treec0d0cbce48775859ff1800c2b0a3ca301e5eb13a
parent9ce9f7999741f342eeffd036ab09213a2fa93040
gpio: mockup: return -EFAULT if copy_from_user() fails

copy_from_user() returns the number of bytes remaining to be copied but
we want to return negative error codes on failue.

Fixes: 9202ba2397d1 ("gpio: mockup: implement event injecting over debugfs")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-mockup.c