From: Vicki Pfau <vi@endrift.com>
To: Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <bentiss@kernel.org>,
linux-input@vger.kernel.org
Cc: Vicki Pfau <vi@endrift.com>, Sashiko <sashiko-bot@kernel.org>
Subject: [PATCH v2 3/3] HID: nintendo-switch2-usb: Clean up urb in probe error path
Date: Tue, 10 Nov 2026 22:49:56 -0800 [thread overview]
Message-ID: <20261111065001.3626071-3-vi@endrift.com> (raw)
In-Reply-To: <20261111065001.3626071-1-vi@endrift.com>
In switch2_usb_probe the error path if the initial urb submission fails
forgets to unanchor the urb. This patch adds that in.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20261111032125.2888320-1-vi%40endrift.com?part=1
Signed-off-by: Vicki Pfau <vi@endrift.com>
---
drivers/hid/hid-nintendo-switch2-usb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hid/hid-nintendo-switch2-usb.c b/drivers/hid/hid-nintendo-switch2-usb.c
index f53cbf0a3e15..8524cc68d5a2 100644
--- a/drivers/hid/hid-nintendo-switch2-usb.c
+++ b/drivers/hid/hid-nintendo-switch2-usb.c
@@ -427,6 +427,8 @@ static int switch2_usb_probe(struct usb_interface *intf, const struct usb_device
ns2_usb->bulk_in[0].state = NS2_URB_OUT;
usb_anchor_urb(ns2_usb->bulk_in[0].urb, &ns2_usb->bulk_in_anchor);
ret = usb_submit_urb(ns2_usb->bulk_in[0].urb, GFP_ATOMIC);
+ if (ret < 0)
+ usb_unanchor_urb(ns2_usb->bulk_in[0].urb);
spin_unlock_irqrestore(&ns2_usb->bulk_in_lock, flags);
if (ret < 0)
--
2.54.0
next prev parent reply other threads:[~2026-11-11 6:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 6:49 [PATCH v2 1/3] HID: nintendo-switch2-usb: Fix potential deadlock on teardown Vicki Pfau
2026-11-11 6:49 ` [PATCH v2 2/3] HID: nintendo-switch2-usb: Improve shutdown logic with inbound message work Vicki Pfau
2026-11-11 6:49 ` Vicki Pfau [this message]
2026-11-11 7:24 ` [PATCH v2 3/3] HID: nintendo-switch2-usb: Clean up urb in probe error path sashiko-bot
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=20261111065001.3626071-3-vi@endrift.com \
--to=vi@endrift.com \
--cc=bentiss@kernel.org \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=sashiko-bot@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