Browse Source

staging: line6: Convert simple_strtoul to strict_strtoul in midi.c

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Shawn Bohrer 15 năm trước cách đây
mục cha
commit
334a33d810
1 tập tin đã thay đổi với 14 bổ sung2 xóa
  1. 14 2
      drivers/staging/line6/midi.c

+ 14 - 2
drivers/staging/line6/midi.c

@@ -318,7 +318,13 @@ static ssize_t midi_set_midi_mask_transmit(struct device *dev,
 {
 	struct usb_interface *interface = to_usb_interface(dev);
 	struct usb_line6 *line6 = usb_get_intfdata(interface);
-	int value = simple_strtoul(buf, NULL, 10);
+	unsigned long value;
+	int ret;
+
+	ret = strict_strtoul(buf, 10, &value);
+	if (ret)
+		return ret;
+
 	line6->line6midi->midi_mask_transmit = value;
 	return count;
 }
@@ -344,7 +350,13 @@ static ssize_t midi_set_midi_mask_receive(struct device *dev,
 {
 	struct usb_interface *interface = to_usb_interface(dev);
 	struct usb_line6 *line6 = usb_get_intfdata(interface);
-	int value = simple_strtoul(buf, NULL, 10);
+	unsigned long value;
+	int ret;
+
+	ret = strict_strtoul(buf, 10, &value);
+	if (ret)
+		return ret;
+
 	line6->line6midi->midi_mask_receive = value;
 	return count;
 }