bbswitch: silently ignore large writes

common-wmi
Lekensteyn 13 years ago
parent c6e50c9a37
commit c10907b6b3

@ -249,10 +249,8 @@ static ssize_t bbswitch_proc_write(struct file *fp, const char __user *buff,
size_t len, loff_t *off) { size_t len, loff_t *off) {
char cmd[8]; char cmd[8];
if (len >= sizeof(cmd)) { if (len >= sizeof(cmd))
printk(KERN_ERR "bbswitch: Input too large (%lu)\n", len); len = sizeof(cmd) - 1;
return -ENOSPC;
}
if (copy_from_user(cmd, buff, len)) if (copy_from_user(cmd, buff, len))
return -EFAULT; return -EFAULT;

Loading…
Cancel
Save