From: Shawn Bohrer Date: Mon, 16 Nov 2009 04:17:59 +0000 (-0600) Subject: staging: line6: Convert simple_strtol to strict_strtol in toneport.c X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bb950a169d98ac9a2b8a899f95ed5d784c14f3cc;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging: line6: Convert simple_strtol to strict_strtol in toneport.c Signed-off-by: Shawn Bohrer Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/line6/toneport.c b/drivers/staging/line6/toneport.c index 84bf29c33515..e6770ea17936 100644 --- a/drivers/staging/line6/toneport.c +++ b/drivers/staging/line6/toneport.c @@ -96,8 +96,14 @@ static ssize_t toneport_set_led_red(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - char *c; - led_red = simple_strtol(buf, &c, 10); + int retval; + long value; + + retval = strict_strtol(buf, 10, &value); + if (retval) + return retval; + + led_red = value; toneport_update_led(dev); return count; } @@ -106,8 +112,14 @@ static ssize_t toneport_set_led_green(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - char *c; - led_green = simple_strtol(buf, &c, 10); + int retval; + long value; + + retval = strict_strtol(buf, 10, &value); + if (retval) + return retval; + + led_green = value; toneport_update_led(dev); return count; }