From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: WenTao Liang <vulab@iscas.ac.cn>
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] fix: drivers/usb/typec/altmodes: dp_altmode_probe: missing typec_altmode_put_plug on error path
Date: Mon, 13 Jul 2026 12:00:00 +0300 [thread overview]
Message-ID: <alSpEMgcTJx398UG@kuha> (raw)
In-Reply-To: <20260627034143.59224-1-vulab@iscas.ac.cn>
Hi,
I hate complain about trivial things, but the subject line has a bit
too much information. You have to improve it.
Please take a look at how the previous commits were written. My
suggestion is that you change it to, for example,
"usb: typec: displayport: Fix a plug altmode leak"
or
"usb: typec: displayport: Add missing typec_altmode_put_plug call"
Thanks,
On Sat, Jun 27, 2026 at 11:41:43AM +0800, WenTao Liang kirjoitti:
> In dp_altmode_probe(), typec_altmode_get_plug() acquires a reference on
> plug. When the data role check fails (TYPEC_HOST check), the function
> returns -EPROTO without calling typec_altmode_put_plug(plug), leaking the
> plug reference. Other error paths (ENODEV, ENOMEM) correctly release the
> reference.
>
> Add typec_altmode_put_plug(plug) before returning on the EPROTO error
> path to fix the leak.
>
> Cc: stable@vger.kernel.org
> Fixes: 41294342fad7 ("usb: typec: altmodes/displayport: do not enter mode if port is the UFP")
> Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
--
heikki
prev parent reply other threads:[~2026-07-13 9:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-27 3:41 [PATCH] fix: drivers/usb/typec/altmodes: dp_altmode_probe: missing typec_altmode_put_plug on error path WenTao Liang
2026-07-13 9:00 ` Heikki Krogerus [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=alSpEMgcTJx398UG@kuha \
--to=heikki.krogerus@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=vulab@iscas.ac.cn \
/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.