|
@@ -63,6 +63,9 @@ read(struct file *file, char __user *userbuf, size_t bytes, loff_t *off)
|
|
int count = min_t(size_t, bytes, PAGE_SIZE);
|
|
int count = min_t(size_t, bytes, PAGE_SIZE);
|
|
char *temp;
|
|
char *temp;
|
|
|
|
|
|
|
|
+ if (!bytes)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
if (size) {
|
|
if (size) {
|
|
if (offs > size)
|
|
if (offs > size)
|
|
return 0;
|
|
return 0;
|
|
@@ -131,6 +134,9 @@ static ssize_t write(struct file *file, const char __user *userbuf,
|
|
int count = min_t(size_t, bytes, PAGE_SIZE);
|
|
int count = min_t(size_t, bytes, PAGE_SIZE);
|
|
char *temp;
|
|
char *temp;
|
|
|
|
|
|
|
|
+ if (!bytes)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
if (size) {
|
|
if (size) {
|
|
if (offs > size)
|
|
if (offs > size)
|
|
return 0;
|
|
return 0;
|