bcache: Fix an error code in bch_dump_read()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 3 Sep 2019 13:25:44 +0000 (21:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:51:09 +0000 (14:51 +0100)
commite7728e18a728bcbd072bca82650b10e0ba55a238
treeb4c3515708f3bedd49cbde8ba3d16ac9fe120e5e
parent2404a2e35aaf74add564abfdb09273bbffae8ace
bcache: Fix an error code in bch_dump_read()

[ Upstream commit d66c9920c0cf984cf99cab5036fd5f3a1b7fba46 ]

The copy_to_user() function returns the number of bytes remaining to be
copied, but the intention here was to return -EFAULT if the copy fails.

Fixes: cafe56359144 ("bcache: A block layer cache")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/bcache/debug.c