1
0
Fork 0
alistair23-linux/drivers/usb/typec
Naoki Kiryu 8dbfb11452 usb: typec: altmode: Fix typec_altmode_get_partner sometimes returning an invalid pointer
commit 0df9433fca upstream.

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-29 16:33:23 +02:00
..
altmodes usb: typec: Add driver for NVIDIA Alt Modes 2019-04-25 11:04:56 +02:00
mux usb: typec: Registering real device entries for the muxes 2019-06-03 10:55:38 +02:00
tcpm usb: typec: tcpm: Ignore CC and vbus changes in PORT_RESET change 2020-04-29 16:33:23 +02:00
ucsi usb: typec: ucsi: displayport: Fix a potential race during registration 2020-03-25 08:25:51 +01:00
Kconfig usb: typec: tps6598x: Fix build error without CONFIG_REGMAP_I2C 2019-09-03 15:46:46 +02:00
Makefile usb: typec: Group all TCPCI/TCPM code together 2018-09-20 13:37:29 +02:00
bus.c usb: typec: altmode: Fix typec_altmode_get_partner sometimes returning an invalid pointer 2020-04-29 16:33:23 +02:00
bus.h usb: typec: Registering real device entries for the muxes 2019-06-03 10:55:38 +02:00
class.c usb: typec: fix use after free in typec_register_port() 2019-12-17 19:56:00 +01:00
mux.c usb: typec: mux: Switch to use fwnode_property_count_uXX() 2019-07-25 11:07:42 +02:00
tps6598x.c drivers/usb/typec/tps6598x.c: fix 4CC cmd write 2019-07-03 18:40:49 +02:00