summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/printk.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index d6a1412..ff05361 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -880,9 +880,7 @@ static int syslog_print(char __user *buf, int size)
syslog_seq++;
raw_spin_unlock_irq(&logbuf_lock);
- if (len > size)
- len = -EINVAL;
- else if (len > 0 && copy_to_user(buf, text, len))
+ if (len > 0 && copy_to_user(buf, text, len))
len = -EFAULT;
kfree(text);
OpenPOWER on IntegriCloud