Commit 2d3a0ca3 authored by Bart Van Assche's avatar Bart Van Assche Committed by Bart Van Assche
Browse files

UPSTREAM: usb: roles: Improve the fix for a false positive recursive locking complaint



Improve commit fc88bb11 ("usb: roles: add lockdep class key to struct
usb_role_switch") as follows:
* Move the lock class key declaration just above the mutex declaration such
  that the declaration order of these objects matches their initialization
  order.
* Destroy the mutex and lock class key just before these objects are
  freed. This makes it easier to verify that the destruction calls happen
  after the last use of these objects.
* Instead of switching the mutex key to the dynamic lock class key after
  initialization of the mutex has completed, initialize the mutex with the
  dynamic lock class key.

Cc: Amit Sunil Dhamne <amitsd@google.com>
Cc: Badhri Jagan Sridharan <badhri@google.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: Ifbe0b6064220c0a4f7bc6be7bcfa23514a635e8c
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240912223956.3554086-4-bvanassche@acm.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 357676850
(cherry picked from commit 7d01ef78)
Signed-off-by: default avatarBart Van Assche <bvanassche@google.com>
parent b0b30406
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment