From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Kuen-Han Tsai <khtsai@google.com>,
gregkh@linuxfoundation.org, prashanth.k@oss.qualcomm.com,
Thinh.Nguyen@synopsys.com, s.hauer@pengutronix.de
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@kernel.org
Subject: Re: [PATCH] usb: gadget: f_ecm: Fix ecm_opts->bound logic in bind path
Date: Wed, 3 Sep 2025 10:33:41 +0200 [thread overview]
Message-ID: <b50f9d10-88a3-4b1c-a75e-6c67b9d1504c@linaro.org> (raw)
In-Reply-To: <20250903083017.795065-1-khtsai@google.com>
On 03/09/2025 10:30, Kuen-Han Tsai wrote:
> The bound flag in ecm_opts is being set to true even if
> gether_register_netdev() failed.
>
> Set ecm_opts->bound to true only upon success.
>
> Fixes: d65e6b6e884a ("usb: gadget: f_ecm: Always set current gadget in ecm_bind()")
> Cc: stable@kernel.org
> Signed-off-by: Kuen-Han Tsai <khtsai@google.com>
> ---
> drivers/usb/gadget/function/f_ecm.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/function/f_ecm.c b/drivers/usb/gadget/function/f_ecm.c
> index 027226325039..9f5ed6f32a62 100644
> --- a/drivers/usb/gadget/function/f_ecm.c
> +++ b/drivers/usb/gadget/function/f_ecm.c
> @@ -690,13 +690,14 @@ ecm_bind(struct usb_configuration *c, struct usb_function *f)
>
> if (!ecm_opts->bound) {
> status = gether_register_netdev(ecm_opts->net);
> - ecm_opts->bound = true;
> }
>
> mutex_unlock(&ecm_opts->lock);
> if (status)
> return status;
>
> + ecm_opts->bound = true;
Now it is outside of mutex, so this is raising questions you should have
answered in commit msg.
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-09-03 8:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-03 8:30 Kuen-Han Tsai
2025-09-03 8:33 ` Krzysztof Kozlowski [this message]
2025-09-04 5:49 ` Kuen-Han Tsai
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=b50f9d10-88a3-4b1c-a75e-6c67b9d1504c@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=Thinh.Nguyen@synopsys.com \
--cc=gregkh@linuxfoundation.org \
--cc=khtsai@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=prashanth.k@oss.qualcomm.com \
--cc=s.hauer@pengutronix.de \
--cc=stable@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®