Commit 22d96a28 authored by Jameson Thies's avatar Jameson Thies Committed by Greg Kroah-Hartman
Browse files

usb: typec: ucsi: Only set number of plug altmodes after registration



Move the setting of the plug's number of alternate modes into the
same condition as the plug's registration to prevent dereferencing the
connector's plug pointer while it is null.

Fixes: c313a44a ("usb: typec: ucsi: Always set number of alternate modes")
Suggested-by: default avatarJon Hunter <jonathanh@nvidia.com>
Signed-off-by: default avatarJameson Thies <jthies@google.com>
Reviewed-by: default avatarBenson Leung <bleung@chromium.org>
Reviewed-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Tested-by: default avatarJon Hunter <jonathanh@nvidia.com>
Reviewed-by: default avatarJon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20240625004607.3223757-1-jthies@google.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 36b1235a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment