mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
driver core: Add missing dev->bus->need_parent_lock checks
__device_release_driver() has to check dev->bus->need_parent_lock
before dropping the parent lock and acquiring it again as it may
attempt to drop a lock that hasn't been acquired or lock a device
that shouldn't be locked and create a lock imbalance.
Fixes: 8c97a46af0 (driver core: hold dev's parent lock when needed)
Signed-off-by: Rafael J. Wysocki <[email protected]>
Cc: stable <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
df44b47965
commit
e121a83374
1 changed files with 2 additions and 2 deletions
|
|
@ -933,11 +933,11 @@ static void __device_release_driver(struct device *dev, struct device *parent)
|
|||
if (drv) {
|
||||
while (device_links_busy(dev)) {
|
||||
device_unlock(dev);
|
||||
if (parent)
|
||||
if (parent && dev->bus->need_parent_lock)
|
||||
device_unlock(parent);
|
||||
|
||||
device_links_unbind_consumers(dev);
|
||||
if (parent)
|
||||
if (parent && dev->bus->need_parent_lock)
|
||||
device_lock(parent);
|
||||
|
||||
device_lock(dev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue