Loading net/bluetooth/hci_sysfs.c +6 −12 Original line number Original line Diff line number Diff line Loading @@ -281,11 +281,9 @@ static ssize_t show_idle_timeout(struct device *dev, struct device_attribute *at static ssize_t store_idle_timeout(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) static ssize_t store_idle_timeout(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { { struct hci_dev *hdev = dev_get_drvdata(dev); struct hci_dev *hdev = dev_get_drvdata(dev); char *ptr; unsigned long val; __u32 val; val = simple_strtoul(buf, &ptr, 10); if (strict_strtoul(buf, 0, &val) < 0) if (ptr == buf) return -EINVAL; return -EINVAL; if (val != 0 && (val < 500 || val > 3600000)) if (val != 0 && (val < 500 || val > 3600000)) Loading @@ -305,11 +303,9 @@ static ssize_t show_sniff_max_interval(struct device *dev, struct device_attribu static ssize_t store_sniff_max_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) static ssize_t store_sniff_max_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { { struct hci_dev *hdev = dev_get_drvdata(dev); struct hci_dev *hdev = dev_get_drvdata(dev); char *ptr; unsigned long val; __u16 val; val = simple_strtoul(buf, &ptr, 10); if (strict_strtoul(buf, 0, &val) < 0) if (ptr == buf) return -EINVAL; return -EINVAL; if (val < 0x0002 || val > 0xFFFE || val % 2) if (val < 0x0002 || val > 0xFFFE || val % 2) Loading @@ -332,11 +328,9 @@ static ssize_t show_sniff_min_interval(struct device *dev, struct device_attribu static ssize_t store_sniff_min_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) static ssize_t store_sniff_min_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { { struct hci_dev *hdev = dev_get_drvdata(dev); struct hci_dev *hdev = dev_get_drvdata(dev); char *ptr; unsigned long val; __u16 val; val = simple_strtoul(buf, &ptr, 10); if (strict_strtoul(buf, 0, &val) < 0) if (ptr == buf) return -EINVAL; return -EINVAL; if (val < 0x0002 || val > 0xFFFE || val % 2) if (val < 0x0002 || val > 0xFFFE || val % 2) Loading Loading
net/bluetooth/hci_sysfs.c +6 −12 Original line number Original line Diff line number Diff line Loading @@ -281,11 +281,9 @@ static ssize_t show_idle_timeout(struct device *dev, struct device_attribute *at static ssize_t store_idle_timeout(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) static ssize_t store_idle_timeout(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { { struct hci_dev *hdev = dev_get_drvdata(dev); struct hci_dev *hdev = dev_get_drvdata(dev); char *ptr; unsigned long val; __u32 val; val = simple_strtoul(buf, &ptr, 10); if (strict_strtoul(buf, 0, &val) < 0) if (ptr == buf) return -EINVAL; return -EINVAL; if (val != 0 && (val < 500 || val > 3600000)) if (val != 0 && (val < 500 || val > 3600000)) Loading @@ -305,11 +303,9 @@ static ssize_t show_sniff_max_interval(struct device *dev, struct device_attribu static ssize_t store_sniff_max_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) static ssize_t store_sniff_max_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { { struct hci_dev *hdev = dev_get_drvdata(dev); struct hci_dev *hdev = dev_get_drvdata(dev); char *ptr; unsigned long val; __u16 val; val = simple_strtoul(buf, &ptr, 10); if (strict_strtoul(buf, 0, &val) < 0) if (ptr == buf) return -EINVAL; return -EINVAL; if (val < 0x0002 || val > 0xFFFE || val % 2) if (val < 0x0002 || val > 0xFFFE || val % 2) Loading @@ -332,11 +328,9 @@ static ssize_t show_sniff_min_interval(struct device *dev, struct device_attribu static ssize_t store_sniff_min_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) static ssize_t store_sniff_min_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { { struct hci_dev *hdev = dev_get_drvdata(dev); struct hci_dev *hdev = dev_get_drvdata(dev); char *ptr; unsigned long val; __u16 val; val = simple_strtoul(buf, &ptr, 10); if (strict_strtoul(buf, 0, &val) < 0) if (ptr == buf) return -EINVAL; return -EINVAL; if (val < 0x0002 || val > 0xFFFE || val % 2) if (val < 0x0002 || val > 0xFFFE || val % 2) Loading