diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-08-05 02:19:08 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-08-05 02:19:08 -0300 |
commit | 8dec7c70575785729a6a9e6719a955e9c545bcab (patch) | |
tree | 897b1b743b2ceb44ace956e8176b6a7e36751019 /drivers/base | |
parent | 4411a04f871d94ae997fb7262a428fe2ee988eb3 (diff) |
Linux-libre 4.6.5-gnupck-4.6.5-gnu
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/module.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/base/module.c b/drivers/base/module.c index db930d3ee..2a215780e 100644 --- a/drivers/base/module.c +++ b/drivers/base/module.c @@ -24,10 +24,12 @@ static char *make_driver_name(struct device_driver *drv) static void module_create_drivers_dir(struct module_kobject *mk) { - if (!mk || mk->drivers_dir) - return; + static DEFINE_MUTEX(drivers_dir_mutex); - mk->drivers_dir = kobject_create_and_add("drivers", &mk->kobj); + mutex_lock(&drivers_dir_mutex); + if (mk && !mk->drivers_dir) + mk->drivers_dir = kobject_create_and_add("drivers", &mk->kobj); + mutex_unlock(&drivers_dir_mutex); } void module_add_driver(struct module *mod, struct device_driver *drv) |