driver core: Add missing dev->bus->need_parent_lock checks
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 13 Dec 2018 18:27:47 +0000 (19:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Dec 2018 09:08:34 +0000 (10:08 +0100)
commite121a833745b4708b660e3fe6776129c2956b041
tree257a38b7dab8b8b141c12d0a28cc7524f5320871
parentdf44b479654f62b478c18ee4d8bc4e9f897a9844
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: 8c97a46af04b (driver core: hold dev's parent lock when needed)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/dd.c