From: "Pandey, Radhey Shyam" <radheys@amd.com>
To: Sven Peter <sven@kernel.org>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: asahi@lists.linux.dev, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: typec: tipd: Zero-initialize CD321x partner descriptor
Date: Sun, 6 Sep 2026 18:26:24 +0530 [thread overview]
Message-ID: <5e125a63-b82b-48cf-a8b7-74515424423a@amd.com> (raw)
In-Reply-To: <20260906-b4-tipd-partner-desc-v1-1-073559f142ff@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>
prev parent reply other threads:[~2026-09-06 12:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-06 12:43 Sven Peter
2026-09-06 12:56 ` Pandey, Radhey Shyam [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5e125a63-b82b-48cf-a8b7-74515424423a@amd.com \
--to=radheys@amd.com \
--cc=asahi@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sven@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®