Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull driver core / sysfs fixes from Greg KH:
"Here are 2 fixes for 3.12-rc3. One fixes a sysfs problem with
mounting caused by 3.12-rc1, and the other is a bug reported by the
chromeos developers with the driver core.

Both have been in linux-next for a bit"

* tag 'driver-core-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
driver core : Fix use after free of dev->parent in device_shutdown
sysfs: Allow mounting without CONFIG_NET

+7 -7
+7 -7
drivers/base/core.c
··· 2017 2017 */ 2018 2018 void device_shutdown(void) 2019 2019 { 2020 - struct device *dev; 2020 + struct device *dev, *parent; 2021 2021 2022 2022 spin_lock(&devices_kset->list_lock); 2023 2023 /* ··· 2034 2034 * prevent it from being freed because parent's 2035 2035 * lock is to be held 2036 2036 */ 2037 - get_device(dev->parent); 2037 + parent = get_device(dev->parent); 2038 2038 get_device(dev); 2039 2039 /* 2040 2040 * Make sure the device is off the kset list, in the ··· 2044 2044 spin_unlock(&devices_kset->list_lock); 2045 2045 2046 2046 /* hold lock to avoid race with probe/release */ 2047 - if (dev->parent) 2048 - device_lock(dev->parent); 2047 + if (parent) 2048 + device_lock(parent); 2049 2049 device_lock(dev); 2050 2050 2051 2051 /* Don't allow any more runtime suspends */ ··· 2063 2063 } 2064 2064 2065 2065 device_unlock(dev); 2066 - if (dev->parent) 2067 - device_unlock(dev->parent); 2066 + if (parent) 2067 + device_unlock(parent); 2068 2068 2069 2069 put_device(dev); 2070 - put_device(dev->parent); 2070 + put_device(parent); 2071 2071 2072 2072 spin_lock(&devices_kset->list_lock); 2073 2073 }