Commit 507662e1 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] EDD: set sysfs attr owner field

From: Matt Domsch <Matt_Domsch@dell.com>

The patch below from Michael E.  Brown properly sets the owner field of a
sysfs attribute.  Without this patch, it is possible to crash the kernel with
a simultaneous insmod/rmmod while reading files exported by the module.
parent fcde1407
......@@ -86,7 +86,7 @@ static struct edd_device *edd_devices[EDDMAXNR];
#define EDD_DEVICE_ATTR(_name,_mode,_show,_test) \
struct edd_attribute edd_attr_##_name = { \
.attr = {.name = __stringify(_name), .mode = _mode }, \
.attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \
.show = _show, \
.test = _test, \
};
......
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