From: Prashant Malani Date: Thu, 29 Oct 2020 22:27:34 +0000 (-0700) Subject: platform/chrome: cros_ec_typec: Clear partner identity on device removal X-Git-Tag: accepted/tizen/unified/20230118.172025~8182^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=514acf1cefd020eb21d7c180050a8d66b723d2d8;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Enric Balletbo i Serra Link: https://lore.kernel.org/r/20201029222738.482366-4-pmalani@chromium.org --- diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c index 2665d81..faef56b 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)