Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cadfbb6e authored by Al Viro's avatar Al Viro Committed by Jens Axboe
Browse files

dax_io(): don't let non-error value escape via retval instead of EFAULT



Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Reported-by: default avatarSasha Levin <sasha.levin@oracle.com>
Cc: stable@vger.kernel.org # 4.0+
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent ccc2600b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;