Skip to content

Commit 0b0c7db

Browse files
committed
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
2 parents 86a7a16 + cd3d9ea commit 0b0c7db

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

drivers/base/Kconfig

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,20 +171,23 @@ config WANT_DEV_COREDUMP
171171
Drivers should "select" this option if they desire to use the
172172
device coredump mechanism.
173173

174-
config DISABLE_DEV_COREDUMP
175-
bool "Disable device coredump" if EXPERT
174+
config ALLOW_DEV_COREDUMP
175+
bool "Allow device coredump" if EXPERT
176+
default y
176177
help
177-
Disable the device coredump mechanism despite drivers wanting to
178-
use it; this allows for more sensitive systems or systems that
179-
don't want to ever access the information to not have the code,
180-
nor keep any data.
178+
This option controls if the device coredump mechanism is available or
179+
not; if disabled, the mechanism will be omitted even if drivers that
180+
can use it are enabled.
181+
Say 'N' for more sensitive systems or systems that don't want
182+
to ever access the information to not have the code, nor keep any
183+
data.
181184

182-
If unsure, say N.
185+
If unsure, say Y.
183186

184187
config DEV_COREDUMP
185188
bool
186189
default y if WANT_DEV_COREDUMP
187-
depends on !DISABLE_DEV_COREDUMP
190+
depends on ALLOW_DEV_COREDUMP
188191

189192
config DEBUG_DRIVER
190193
bool "Driver Core verbose debug messages"

drivers/base/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,12 +724,12 @@ class_dir_create_and_add(struct class *class, struct kobject *parent_kobj)
724724
return &dir->kobj;
725725
}
726726

727+
static DEFINE_MUTEX(gdp_mutex);
727728

728729
static struct kobject *get_device_parent(struct device *dev,
729730
struct device *parent)
730731
{
731732
if (dev->class) {
732-
static DEFINE_MUTEX(gdp_mutex);
733733
struct kobject *kobj = NULL;
734734
struct kobject *parent_kobj;
735735
struct kobject *k;
@@ -793,7 +793,9 @@ static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)
793793
glue_dir->kset != &dev->class->p->glue_dirs)
794794
return;
795795

796+
mutex_lock(&gdp_mutex);
796797
kobject_put(glue_dir);
798+
mutex_unlock(&gdp_mutex);
797799
}
798800

799801
static void cleanup_device_parent(struct device *dev)

0 commit comments

Comments
 (0)