summaryrefslogtreecommitdiffstats
path: root/kernel/printk
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-11-01 22:09:04 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-12-05 14:33:36 -0500
commitcbbd26b8b1a6af9c02e2b6523e12bd50cc765059 (patch)
tree6d1b258c99e83f320cf3611bdc927121df7e9b03 /kernel/printk
parente5517c2a5a49ed5e99047008629f1cd60246ea0e (diff)
downloadop-kernel-dev-cbbd26b8b1a6af9c02e2b6523e12bd50cc765059.zip
op-kernel-dev-cbbd26b8b1a6af9c02e2b6523e12bd50cc765059.tar.gz
[iov_iter] new primitives - copy_from_iter_full() and friends
copy_from_iter_full(), copy_from_iter_full_nocache() and csum_and_copy_from_iter_full() - counterparts of copy_from_iter() et.al., advancing iterator only in case of successful full copy and returning whether it had been successful or not. Convert some obvious users. *NOTE* - do not blindly assume that something is a good candidate for those unless you are sure that not advancing iov_iter in failure case is the right thing in this case. Anything that does short read/short write kind of stuff (or is in a loop, etc.) is unlikely to be a good one. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel/printk')
-rw-r--r--kernel/printk/printk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index f7a55e9..f6bda15 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -748,7 +748,7 @@ static ssize_t devkmsg_write(struct kiocb *iocb, struct iov_iter *from)
return -ENOMEM;
buf[len] = '\0';
- if (copy_from_iter(buf, len, from) != len) {
+ if (!copy_from_iter_full(buf, len, from)) {
kfree(buf);
return -EFAULT;
}
OpenPOWER on IntegriCloud