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
Drivers should "select" this option if they desire to use the
device coredump mechanism.
config DISABLE_DEV_COREDUMP
bool "Disable device coredump" if EXPERT
config ALLOW_DEV_COREDUMP
bool "Allow device coredump" if EXPERT
default y
help
Disable the device coredump mechanism despite drivers wanting to
use it; this allows for more sensitive systems or systems that
don't want to ever access the information to not have the code,
nor keep any data.
This option controls if the device coredump mechanism is available or
not; if disabled, the mechanism will be omitted even if drivers that
can use it are enabled.
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
bool
default y if WANT_DEV_COREDUMP
depends on !DISABLE_DEV_COREDUMP
depends on ALLOW_DEV_COREDUMP
config DEBUG_DRIVER
bool "Driver Core verbose debug messages"
......
......@@ -724,12 +724,12 @@ class_dir_create_and_add(struct class *class, struct kobject *parent_kobj)
return &dir->kobj;
}
static DEFINE_MUTEX(gdp_mutex);
static struct kobject *get_device_parent(struct device *dev,
struct device *parent)
{
if (dev->class) {
static DEFINE_MUTEX(gdp_mutex);
struct kobject *kobj = NULL;
struct kobject *parent_kobj;
struct kobject *k;
......@@ -793,7 +793,9 @@ static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)
glue_dir->kset != &dev->class->p->glue_dirs)
return;
mutex_lock(&gdp_mutex);
kobject_put(glue_dir);
mutex_unlock(&gdp_mutex);
}
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