All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
	Johan Hovold <johan@kernel.org>,
	stable@vger.kernel.org, Rajat Jain <rajatja@google.com>
Subject: [PATCH v3 RESEND 3/5] Bluetooth: btusb: fix wakeup source leak on probe failure
Date: Wed,  3 Jun 2026 16:36:41 +0200	[thread overview]
Message-ID: <20260603143643.2514595-4-johan@kernel.org> (raw)
In-Reply-To: <20260603143643.2514595-1-johan@kernel.org>

Make sure to disable wakeup on probe failure to avoid leaking the wakeup
source.

Fixes: fd913ef7ce61 ("Bluetooth: btusb: Add out-of-band wakeup support")
Cc: stable@vger.kernel.org	# 4.11
Cc: Rajat Jain <rajatja@google.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/bluetooth/btusb.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index d0a83a1ffdf2..622df2fff497 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -4181,7 +4181,7 @@ static int btusb_probe(struct usb_interface *intf,
 	if (id->driver_info & BTUSB_MARVELL && data->oob_wake_irq) {
 		err = marvell_config_oob_wake(hdev);
 		if (err)
-			goto out_free_dev;
+			goto err_disable_wakeup;
 	}
 #endif
 	if (id->driver_info & BTUSB_CW6622)
@@ -4427,6 +4427,9 @@ static int btusb_probe(struct usb_interface *intf,
 	}
 err_kill_tx_urbs:
 	usb_kill_anchored_urbs(&data->tx_anchor);
+err_disable_wakeup:
+	if (data->oob_wake_irq)
+		device_init_wakeup(&data->udev->dev, false);
 out_free_dev:
 	if (data->reset_gpio)
 		gpiod_put(data->reset_gpio);
-- 
2.53.0


  parent reply	other threads:[~2026-06-03 14:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-03 14:36 [PATCH v3 RESEND 0/5] Bluetooth: btusb: fix wakeup irq devres lifetime Johan Hovold
2026-06-03 14:36 ` [PATCH v3 RESEND 1/5] Bluetooth: btusb: fix use-after-free on registration failure Johan Hovold
2026-06-03 17:36   ` Bluetooth: btusb: fix wakeup irq devres lifetime bluez.test.bot
2026-06-03 14:36 ` [PATCH v3 RESEND 2/5] Bluetooth: btusb: fix use-after-free on marvell probe failure Johan Hovold
2026-06-03 14:36 ` Johan Hovold [this message]
2026-06-03 18:06   ` [PATCH v3 RESEND 3/5] Bluetooth: btusb: fix wakeup source leak on " Luiz Augusto von Dentz
2026-06-04  6:41     ` Johan Hovold
2026-06-03 14:36 ` [PATCH v3 RESEND 4/5] Bluetooth: btusb: fix wakeup irq devres lifetime Johan Hovold
2026-06-03 14:36 ` [PATCH v3 RESEND 5/5] Bluetooth: btusb: clean up probe error handling Johan Hovold

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=20260603143643.2514595-4-johan@kernel.org \
    --to=johan@kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=rajatja@google.com \
    --cc=stable@vger.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 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.