From: Al Viro Date: Wed, 11 Nov 2015 02:42:49 +0000 (-0700) Subject: dax_io(): don't let non-error value escape via retval instead of EFAULT X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cadfbb6ec2e55171479191046142c927a8b12d87;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git dax_io(): don't let non-error value escape via retval instead of EFAULT Signed-off-by: Al Viro Reported-by: Sasha Levin Cc: stable@vger.kernel.org # 4.0+ Signed-off-by: Jens Axboe --- diff --git a/fs/dax.c b/fs/dax.c index a86d3cc2b389..7b653e9aa8d1 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -169,8 +169,10 @@ static ssize_t dax_io(struct inode *inode, struct iov_iter *iter, else len = iov_iter_zero(max - pos, iter); - if (!len) + if (!len) { + retval = -EFAULT; break; + } pos += len; addr += len;