Skip to content
Commit 3f345e90 authored by Heikki Krogerus's avatar Heikki Krogerus Committed by Greg Kroah-Hartman
Browse files

usb: typec: ucsi: Only check the contract if there is a connection

The driver must make sure there is an actual connection
before checking details about the USB Power Delivery
contract. Those details are not valid unless there is a
connection.

This fixes NULL pointer dereference that is caused by an
attempt to register bogus partner alternate mode that the
firmware on some platform may report before the actual
connection.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=215117
Fixes: 6cbe4b2d

 ("usb: typec: ucsi: Check the partner alt modes always if there is PD contract")
Reported-by: default avatarChris Hixon <linux-kernel-bugs@hixontech.com>
Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/eb34f98f-00ef-3238-2daa-80481116035d@leemhuis.info/
Link: https://lore.kernel.org/r/20211221140352.45501-1-heikki.krogerus@linux.intel.com
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e4844092
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment