diff options
| author | 2008-07-18 19:31:12 +0200 | |
|---|---|---|
| committer | 2008-07-18 19:31:12 +0200 | |
| commit | 3e370b29d35fb01bfb92c2814d6f79bf6a2cb970 (patch) | |
| tree | 3b8fb467d60bfe6a34686f4abdc3a60050ba40a4 /drivers/acpi/fan.c | |
| parent | PCI quirks: call boot IRQ quirks at end of device init and during resume (diff) | |
| parent | Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2 (diff) | |
| download | linux-dev-3e370b29d35fb01bfb92c2814d6f79bf6a2cb970.tar.xz linux-dev-3e370b29d35fb01bfb92c2814d6f79bf6a2cb970.zip | |
Merge branch 'linus' into x86/pci-ioapic-boot-irq-quirks
Conflicts:
drivers/pci/quirks.c
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/acpi/fan.c')
| -rw-r--r-- | drivers/acpi/fan.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index 6cf10cbc1eee..55c17afbe669 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c @@ -148,7 +148,7 @@ acpi_fan_write_state(struct file *file, const char __user * buffer, int result = 0; struct seq_file *m = file->private_data; struct acpi_device *device = m->private; - char state_string[12] = { '\0' }; + char state_string[3] = { '\0' }; if (count > sizeof(state_string) - 1) return -EINVAL; @@ -157,6 +157,12 @@ acpi_fan_write_state(struct file *file, const char __user * buffer, return -EFAULT; state_string[count] = '\0'; + if ((state_string[0] < '0') || (state_string[0] > '3')) + return -EINVAL; + if (state_string[1] == '\n') + state_string[1] = '\0'; + if (state_string[1] != '\0') + return -EINVAL; result = acpi_bus_set_power(device->handle, simple_strtoul(state_string, NULL, 0)); |
