提交 22af74f3 编写于 作者: K Kay Sievers 提交者: Greg Kroah-Hartman

Driver core: warn when userspace writes to the uevent file in a non-supported way

In the future we will allow the uevent type to be written to the uevent
file to trigger the different types of uevents.  But for now, as we only
support the ADD event, warn if userspace tries to write anything else to
this file.
Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 16574dcc
......@@ -296,6 +296,9 @@ static ssize_t show_uevent(struct device *dev, struct device_attribute *attr,
static ssize_t store_uevent(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
if (memcmp(buf, "add", 3) != 0)
dev_err(dev, "uevent: unsupported action-string; this will "
"be ignored in a future kernel version");
kobject_uevent(&dev->kobj, KOBJ_ADD);
return count;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册