summaryrefslogtreecommitdiff
path: root/drivers/platform/chrome
diff options
context:
space:
mode:
authorPrashant Malani <pmalani@chromium.org>2020-10-30 01:27:34 +0300
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>2020-11-12 23:32:09 +0300
commit514acf1cefd020eb21d7c180050a8d66b723d2d8 (patch)
treed51d43628d22f1b81447cd5f85e0af8a0eb07f5d /drivers/platform/chrome
parent7ab5a673f4ce65875c76e9812d2e6da063b87fb7 (diff)
downloadlinux-514acf1cefd020eb21d7c180050a8d66b723d2d8.tar.xz
platform/chrome: cros_ec_typec: Clear partner identity on device removal
The partner identity struct isn't reset when a partner is removed, meaning a subsequent partner can inherit an old partner's identity VDOs before discovery is complete. So, clear that struct when a partner removal is detected. Signed-off-by: Prashant Malani <pmalani@chromium.org> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Link: https://lore.kernel.org/r/20201029222738.482366-4-pmalani@chromium.org
Diffstat (limited to 'drivers/platform/chrome')
-rw-r--r--drivers/platform/chrome/cros_ec_typec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index 2665d8125910..faef56bcb9c5 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -181,6 +181,7 @@ static void cros_typec_remove_partner(struct cros_typec_data *typec,
typec_unregister_partner(port->partner);
port->partner = NULL;
+ memset(&port->p_identity, 0, sizeof(port->p_identity));
}
static void cros_unregister_ports(struct cros_typec_data *typec)