summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorMichael E. Brown <mebrown@michaels-house.net>2004-04-21 22:19:51 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-04-21 22:19:51 -0700
commit78fdb0c470f685df81f2d8cc2dce59bac9be1b12 (patch)
tree3bca519f49896a583569b6a329595927283c8077 /drivers/base
parent17d5007f3f65fa3de08ed8466da05a5d2bab077d (diff)
[PATCH] sysfs module unload race fix for bin_attributes
- Add module locking to sysfs bin_attribute files. Update all in-tree users to set module owner. Compile tested. booted. stress tests pass: while true; do modprobe mymod; rmmod mymod; done & while true; do hexdump -C /sys/path/to/sysfs/binary/file; done
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/firmware_class.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 696038e7b34c..8ff239f146cf 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -254,7 +254,7 @@ out:
return retval;
}
static struct bin_attribute firmware_attr_data_tmpl = {
- .attr = {.name = "data", .mode = 0644},
+ .attr = {.name = "data", .mode = 0644, .owner = THIS_MODULE},
.size = 0,
.read = firmware_data_read,
.write = firmware_data_write,