driver core: Add missing dev->bus->need_parent_lock checks
commit5781b53dd89c1034daa0929fe98f87f87d1af914
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 13 Dec 2018 18:27:47 +0000 (13 19:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Jan 2019 08:51:06 +0000 (13 09:51 +0100)
tree6f3e6a5c3f884ca06991581aeb169abbb1f26aee
parentb57b3b00828467b922838731827385174ae9a9c9
driver core: Add missing dev->bus->need_parent_lock checks

commit e121a833745b4708b660e3fe6776129c2956b041 upstream.

__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