Commit 0b0c7dbd authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'driver-core-3.18-rc4' of...

Merge tag 'driver-core-3.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core fixes from Greg KH:
 "Here are 3 tiny fixes for 3.18-rc4.

  One fixes up a long-stading race condition in the driver core for
  removing directories in /sys/devices/virtual/ and the other 2 fix up
  the wording of a new Kconfig option that was added in 3.18-rc1"

* tag 'driver-core-3.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  tiny: rename ENABLE_DEV_COREDUMP to ALLOW_DEV_COREDUMP
  tiny: reverse logic for DISABLE_DEV_COREDUMP
  sysfs: driver core: Fix glue dir race condition by gdp_mutex
parents 86a7a167 cd3d9ea1
...@@ -171,20 +171,23 @@ config WANT_DEV_COREDUMP ...@@ -171,20 +171,23 @@ config WANT_DEV_COREDUMP
Drivers should "select" this option if they desire to use the Drivers should "select" this option if they desire to use the
device coredump mechanism. device coredump mechanism.
config DISABLE_DEV_COREDUMP config ALLOW_DEV_COREDUMP
bool "Disable device coredump" if EXPERT bool "Allow device coredump" if EXPERT
default y
help help
Disable the device coredump mechanism despite drivers wanting to This option controls if the device coredump mechanism is available or
use it; this allows for more sensitive systems or systems that not; if disabled, the mechanism will be omitted even if drivers that
don't want to ever access the information to not have the code, can use it are enabled.
nor keep any data. Say 'N' for more sensitive systems or systems that don't want
to ever access the information to not have the code, nor keep any
data.
If unsure, say N. If unsure, say Y.
config DEV_COREDUMP config DEV_COREDUMP
bool bool
default y if WANT_DEV_COREDUMP default y if WANT_DEV_COREDUMP
depends on !DISABLE_DEV_COREDUMP depends on ALLOW_DEV_COREDUMP
config DEBUG_DRIVER config DEBUG_DRIVER
bool "Driver Core verbose debug messages" bool "Driver Core verbose debug messages"
......
...@@ -724,12 +724,12 @@ class_dir_create_and_add(struct class *class, struct kobject *parent_kobj) ...@@ -724,12 +724,12 @@ class_dir_create_and_add(struct class *class, struct kobject *parent_kobj)
return &dir->kobj; return &dir->kobj;
} }
static DEFINE_MUTEX(gdp_mutex);
static struct kobject *get_device_parent(struct device *dev, static struct kobject *get_device_parent(struct device *dev,
struct device *parent) struct device *parent)
{ {
if (dev->class) { if (dev->class) {
static DEFINE_MUTEX(gdp_mutex);
struct kobject *kobj = NULL; struct kobject *kobj = NULL;
struct kobject *parent_kobj; struct kobject *parent_kobj;
struct kobject *k; struct kobject *k;
...@@ -793,7 +793,9 @@ static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir) ...@@ -793,7 +793,9 @@ static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)
glue_dir->kset != &dev->class->p->glue_dirs) glue_dir->kset != &dev->class->p->glue_dirs)
return; return;
mutex_lock(&gdp_mutex);
kobject_put(glue_dir); kobject_put(glue_dir);
mutex_unlock(&gdp_mutex);
} }
static void cleanup_device_parent(struct device *dev) static void cleanup_device_parent(struct device *dev)
......
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