UPSTREAM: usb: typec: class: Fix NULL pointer access
commit ec27386d upstream. Concurrent calls to typec_partner_unlink_device can lead to a NULL pointer dereference. This patch adds a mutex to protect USB device pointers and prevent this issue. The same mutex protects both the device pointers and the partner device registration. Cc: stable@vger.kernel.org Fixes: 59de2a56 ("usb: typec: Link enumerated USB devices with Type-C partner") Change-Id: Iddced47b0eaeec7571522687dd18429cb019821a Signed-off-by:Andrei Kuchynski <akuchynski@chromium.org> Reviewed-by:
Benson Leung <bleung@chromium.org> Reviewed-by:
Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20250321143728.4092417-2-akuchynski@chromium.org Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit de7c24fe) Bug: 437846539 Signed-off-by:
Greg Kroah-Hartman <gregkh@google.com>
Loading