aboutsummaryrefslogtreecommitdiffstats
path: root/fs/read_write.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/read_write.c')
-rw-r--r--fs/read_write.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index f7b5a23b804b..e6ddc8dceb96 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -424,6 +424,9 @@ ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t
424 const char __user *p; 424 const char __user *p;
425 ssize_t ret; 425 ssize_t ret;
426 426
427 if (!file->f_op || (!file->f_op->write && !file->f_op->aio_write))
428 return -EINVAL;
429
427 old_fs = get_fs(); 430 old_fs = get_fs();
428 set_fs(get_ds()); 431 set_fs(get_ds());
429 p = (__force const char __user *)buf; 432 p = (__force const char __user *)buf;