drivers/usb/typec/tipd/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
The typec_partner_desc struct isn't initialized and instead filled with
whatever values happen to be on the stack. We especially don't overwrite
the attach/detach callbacks. Just zero initialize it to make sure we don't
run into weird issues in the future.
Fixes: 82432bbfb9e8 ("usb: typec: tipd: Handle mode transitions for CD321x")
Signed-off-by: Sven Peter <sven@kernel.org>
---
I deliberately didn't cc stable@ since we can't even reach the path
that would try to run these callbacks on platforms where this is used.
Just noticed this while working on the USB4/Thunderbolt series for Apple
Silicon.
---
drivers/usb/typec/tipd/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
index 522f56742aa9..07d6d88e3a0e 100644
--- a/drivers/usb/typec/tipd/core.c
+++ b/drivers/usb/typec/tipd/core.c
@@ -841,7 +841,7 @@ static void cd321x_update_work(struct work_struct *work)
/* Set up partner if we were previously disconnected (or changed). */
if (!tps->partner) {
- struct typec_partner_desc desc;
+ struct typec_partner_desc desc = { };
desc.usb_pd = is_pd;
desc.accessory = TYPEC_ACCESSORY_NONE; /* XXX: handle accessories */
---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260906-b4-tipd-partner-desc-07915a127b0a
Best regards,
--
Sven Peter <sven@kernel.org>
On 9/6/2026 6:13 PM, Sven Peter wrote:
> The typec_partner_desc struct isn't initialized and instead filled with
> whatever values happen to be on the stack. We especially don't overwrite
> the attach/detach callbacks. Just zero initialize it to make sure we don't
> run into weird issues in the future.
>
> Fixes: 82432bbfb9e8 ("usb: typec: tipd: Handle mode transitions for CD321x")
> Signed-off-by: Sven Peter <sven@kernel.org>
Thanks for the patch. FYI - i have already fix it in below series[1] and
will resend next version as it is not merged yet.
[1]:
https://lore.kernel.org/all/20260812161454.149606-1-radhey.shyam.pandey@amd.com/
> ---
> I deliberately didn't cc stable@ since we can't even reach the path
> that would try to run these callbacks on platforms where this is used.
> Just noticed this while working on the USB4/Thunderbolt series for Apple
> Silicon.
> ---
> drivers/usb/typec/tipd/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
> index 522f56742aa9..07d6d88e3a0e 100644
> --- a/drivers/usb/typec/tipd/core.c
> +++ b/drivers/usb/typec/tipd/core.c
> @@ -841,7 +841,7 @@ static void cd321x_update_work(struct work_struct *work)
>
> /* Set up partner if we were previously disconnected (or changed). */
> if (!tps->partner) {
> - struct typec_partner_desc desc;
> + struct typec_partner_desc desc = { };
>
> desc.usb_pd = is_pd;
> desc.accessory = TYPEC_ACCESSORY_NONE; /* XXX: handle accessories */
>
> ---
> base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
> change-id: 20260906-b4-tipd-partner-desc-07915a127b0a
>
> Best regards,
> --
> Sven Peter <sven@kernel.org>
© 2016 - 2026 Red Hat, Inc.