diff options
| -rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 27d68e719e90..18f9ee63c50a 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
| @@ -766,6 +766,8 @@ static int dispatch_procfs_write(struct file *file, | |||
| 766 | 766 | ||
| 767 | if (!ibm || !ibm->write) | 767 | if (!ibm || !ibm->write) |
| 768 | return -EINVAL; | 768 | return -EINVAL; |
| 769 | if (count > PAGE_SIZE - 2) | ||
| 770 | return -EINVAL; | ||
| 769 | 771 | ||
| 770 | kernbuf = kmalloc(count + 2, GFP_KERNEL); | 772 | kernbuf = kmalloc(count + 2, GFP_KERNEL); |
| 771 | if (!kernbuf) | 773 | if (!kernbuf) |
