diff options
author | Prashant Malani <pmalani@chromium.org> | 2020-10-29 23:27:34 +0100 |
---|---|---|
committer | Enric Balletbo i Serra <enric.balletbo@collabora.com> | 2020-11-12 21:32:09 +0100 |
commit | 514acf1cefd020eb21d7c180050a8d66b723d2d8 (patch) | |
tree | d51d43628d22f1b81447cd5f85e0af8a0eb07f5d /drivers/platform/chrome | |
parent | platform/chrome: cros_ec_typec: Fix remove partner logic (diff) | |
download | linux-514acf1cefd020eb21d7c180050a8d66b723d2d8.tar.xz linux-514acf1cefd020eb21d7c180050a8d66b723d2d8.zip |
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.c | 1 |
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) |