BigW Consortium Gitlab

Commit 3cd13e52 by David Frey

Don't accept values < 0 in LED driver sysfs file

parent e6b8e4ba
......@@ -22,10 +22,10 @@ static int led_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct led_device* led = dev_get_drvdata(dev);
unsigned int val;
u8 val;
int ret;
ret = kstrtoint(buf, 10, &val);
ret = kstrtou8(buf, 10, &val);
if (ret || val > 1)
return -EINVAL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment