Skip to content

Commit

Permalink
Merge tag 'driver-core-3.18-rc4' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/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
  • Loading branch information
Linus Torvalds committed Nov 9, 2014
2 parents 86a7a16 + cd3d9ea commit 0b0c7db
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
19 changes: 11 additions & 8 deletions drivers/base/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0b0c7db

Please sign in to comment.