linux/drivers/usb/typec
Naoki Kiryu 0df9433fca usb: typec: altmode: Fix typec_altmode_get_partner sometimes returning an invalid pointer
Before this commit, typec_altmode_get_partner would return a
const struct typec_altmode * pointing to address 0x08 when
to_altmode(adev)->partner was NULL.

Add a check for to_altmode(adev)->partner being NULL to fix this.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206365
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1785972
Fixes: 5f54a85db5 ("usb: typec: Make sure an alt mode exist before getting its partner")
Cc: stable@vger.kernel.org
Signed-off-by: Naoki Kiryu <naonaokiryu2@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20200422144345.43262-1-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-22 19:23:19 +02:00
..
altmodes usb: typec: Add parameter for the VDO to typec_altmode_enter() 2020-01-09 10:48:19 +01:00
mux usb: typec: pi3usb30532: Set switch_ / mux_desc name field to NULL 2020-04-16 14:52:09 +02:00
tcpm usb: typec: tcpm: Ignore CC and vbus changes in PORT_RESET change 2020-04-16 15:01:42 +02:00
ucsi Merge 5.6-rc7 into usb-next 2020-03-23 08:04:08 +01:00
Kconfig usb: typec: add dependency for TYPEC_HD3SS3220 2019-10-10 12:34:05 +02:00
Makefile usb: typec: driver for TI HD3SS3220 USB Type-C DRP port controller 2019-10-04 14:18:48 +02:00
bus.c usb: typec: altmode: Fix typec_altmode_get_partner sometimes returning an invalid pointer 2020-04-22 19:23:19 +02:00
bus.h usb: typec: altmode: Remove the notification chain 2020-02-12 10:51:21 -08:00
class.c usb: typec: Correct the documentation for typec_cable_put() 2020-03-26 15:05:43 +01:00
hd3ss3220.c usb: typec: hd3ss3220: Give the connector fwnode to the port device 2019-11-04 16:03:36 +01:00
mux.c usb: typec: mux: Allow the mux handles to be requested with fwnode 2020-03-04 11:12:49 +01:00
tps6598x.c usb: typec: tps6598x: Start using struct typec_operations 2019-11-04 16:03:34 +01:00