staging: line6: Convert simple_strtol to strict_strtol in toneport.c
authorShawn Bohrer <shawn.bohrer@gmail.com>
Mon, 16 Nov 2009 04:17:59 +0000 (22:17 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Dec 2009 20:21:47 +0000 (12:21 -0800)
Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/line6/toneport.c

index 84bf29c33515f58af6ccbc9963ee71423e4d04d4..e6770ea179364e8579d7646d72fec4c0379c64bf 100644 (file)
@@ -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;
 }