aboutsummaryrefslogtreecommitdiffstats
path: root/block/bsg.c
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-01-17 23:50:44 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-01-17 23:50:44 +0100
commit3619db98361964903b81cfad1df177ba2545adb3 (patch)
tree191ee340010c9e826319d5091cdc907dc883dfef /block/bsg.c
parentd5330e2aff68913334e7571d8f101295557c9339 (diff)
parentd366ce9f4a0b8bd1614559a0582279832f041176 (diff)
downloadkernel_samsung_smdk4412-3619db98361964903b81cfad1df177ba2545adb3.zip
kernel_samsung_smdk4412-3619db98361964903b81cfad1df177ba2545adb3.tar.gz
kernel_samsung_smdk4412-3619db98361964903b81cfad1df177ba2545adb3.tar.bz2
Merge remote-tracking branch 'lineageos/cm-13.0' into replicant-6.0
Diffstat (limited to 'block/bsg.c')
-rw-r--r--block/bsg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/bsg.c b/block/bsg.c
index 792ead6..73e5eb4 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -675,6 +675,9 @@ bsg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
dprintk("%s: write %Zd bytes\n", bd->name, count);
+ if (unlikely(segment_eq(get_fs(), KERNEL_DS)))
+ return -EINVAL;
+
bsg_set_block(bd, file);
bytes_written = 0;