aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysfs')
-rw-r--r--fs/sysfs/bin.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index 66f6e58a7e4b..f2c478c3424e 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -63,6 +63,9 @@ read(struct file *file, char __user *userbuf, size_t bytes, loff_t *off)
63 int count = min_t(size_t, bytes, PAGE_SIZE); 63 int count = min_t(size_t, bytes, PAGE_SIZE);
64 char *temp; 64 char *temp;
65 65
66 if (!bytes)
67 return 0;
68
66 if (size) { 69 if (size) {
67 if (offs > size) 70 if (offs > size)
68 return 0; 71 return 0;
@@ -131,6 +134,9 @@ static ssize_t write(struct file *file, const char __user *userbuf,
131 int count = min_t(size_t, bytes, PAGE_SIZE); 134 int count = min_t(size_t, bytes, PAGE_SIZE);
132 char *temp; 135 char *temp;
133 136
137 if (!bytes)
138 return 0;
139
134 if (size) { 140 if (size) {
135 if (offs > size) 141 if (offs > size)
136 return 0; 142 return 0;