summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/battery.c
diff options
context:
space:
mode:
authorChristoph Jaeger <christophjaeger@linux.com>2014-06-13 21:49:58 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-06-17 14:01:56 +0200
commit3d915894f8317ac3e55b47da829aa65eb5f9ae97 (patch)
treef8e523b5f549d1a3779c01b51c2900f057e52dd7 /drivers/acpi/battery.c
parentLinux 3.16-rc1 (diff)
downloadlinux-3d915894f8317ac3e55b47da829aa65eb5f9ae97.tar.xz
linux-3d915894f8317ac3e55b47da829aa65eb5f9ae97.zip
ACPI: use kstrto*() instead of simple_strto*()
simple_strto*() are obsolete; use kstrto*() instead. Add proper error checking. Signed-off-by: Christoph Jaeger <christophjaeger@linux.com> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/battery.c')
-rw-r--r--drivers/acpi/battery.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index e48fc98e71c4..5963e6f0a1ed 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -930,7 +930,10 @@ static ssize_t acpi_battery_write_alarm(struct file *file,
goto end;
}
alarm_string[count] = '\0';
- battery->alarm = simple_strtol(alarm_string, NULL, 0);
+ if (kstrtoint(alarm_string, 0, &battery->alarm)) {
+ result = -EINVAL;
+ goto end;
+ }
result = acpi_battery_set_alarm(battery);
end:
if (!result)