Skip to content

Commit

Permalink
dax_io(): don't let non-error value escape via retval instead of EFAULT
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
Reported-by: Sasha Levin <[email protected]>
Cc: [email protected] # 4.0+
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Al Viro authored and axboe committed Nov 11, 2015
1 parent ccc2600 commit cadfbb6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/dax.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cadfbb6

Please sign in to comment.