All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Suyuan Wang" <shyckless@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH] thunderbolt: Keep the USB4 port when component_add() fails
Date: Thu, 12 Nov 2026 10:00:13 +0000	[thread overview]
Message-ID: <sashiko-outbox-210915@kernel.org> (raw)
In-Reply-To: <20261112-thunderbolt-v1-1-fc30057cb7cd@gmail.com>

> From: Suyuan Wang <stevewong@hust.edu.cn>
> 
> When component_add() fails, usb4_port_device_add() unregisters the
> device but doesn't return:
> 
>     ret = component_add(&usb4->dev, &connector_ops);
>     if (ret) {
>             dev_err(&usb4->dev, "failed to add component\n");
>             device_unregister(&usb4->dev);
>     }
> 
> The port was registered just before, so device_unregister() normally
> drops the last reference and usb4_port_device_release() frees usb4.
> The function still goes on to set up runtime PM on usb4->dev and
> returns usb4 to usb4_switch_add_ports(), which stores the stale pointer
> [ ... ]
> Suggested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Cc: stable@vger.kernel.org
> Co-developed-by: Kaixuan Li <kaixuan.li@ntu.edu.sg>
> Signed-off-by: Kaixuan Li <kaixuan.li@ntu.edu.sg>
> Signed-off-by: Suyuan Wang <stevewong@hust.edu.cn>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261112-thunderbolt-v1-1-fc30057cb7cd@gmail.com?part=1


      reply	other threads:[~2026-11-12 10:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  9:57 [PATCH] thunderbolt: Keep the USB4 port when component_add() fails Suyuan Wang via B4 Relay
2026-11-12  9:57 ` Suyuan Wang
2026-11-12 10:00 ` sashiko-bot [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=sashiko-outbox-210915@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shyckless@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.