public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/18] wifi: drop redundant USB device references
@ 2026-03-06  8:51 Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 01/18] wifi: ath6kl: drop redundant device reference Johan Hovold
                   ` (20 more replies)
  0 siblings, 21 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop redundant device references to reduce cargo culting, make it easier
to spot drivers where an extra reference is needed, and reduce the risk
of memory leaks when drivers fail to release them.

Note that I sent an ath9k patch separately here:

	https://lore.kernel.org/all/20260305105803.17011-1-johan@kernel.org/

but I included it here in v2 for completeness.

Also note that Greg had already sent a fix for rtw88 which has been
picked up by Ping-Ke, but who asked me to send a replacement. If an
incremental patch is preferred I can instead send a follow up for that
one later.

Johan


Changes in v2:
 - include ath9k, previously submitted separately
 - include ath6kl and ath10k
 - rename the ath6kl and ath10k disconnect callbacks
 - fix a reference leak in rtw88 previously reported (and fixed
   differently) by Greg


Johan Hovold (18):
  wifi: ath6kl: drop redundant device reference
  wifi: ath6kl: rename disconnect callback
  wifi: ath9k: drop redundant device reference
  wifi: ath10k: drop redundant device reference
  wifi: ath10k: rename disconnect callback
  wifi: at76c50x: drop redundant device reference
  wifi: libertas: drop redundant device reference
  wifi: libertas_tf: drop redundant device reference
  wifi: mwifiex: drop redundant device reference
  wifi: mt76: drop redundant device reference
  wifi: mt76x0u: drop redundant device reference
  wifi: mt76x2u: drop redundant device reference
  wifi: mt76: mt792xu: drop redundant device reference
  wifi: mt7601u: drop redundant device reference
  wifi: rt2x00: drop redundant device reference
  wifi: rtl818x: drop redundant device reference
  wifi: rtl8xxxu: drop redundant device reference
  wifi: rtw88: fix device leak on probe failure

 drivers/net/wireless/ath/ath10k/usb.c            |  8 ++------
 drivers/net/wireless/ath/ath6kl/usb.c            | 16 ++++------------
 drivers/net/wireless/ath/ath9k/hif_usb.c         |  4 ----
 drivers/net/wireless/atmel/at76c50x-usb.c        | 12 ++++--------
 drivers/net/wireless/marvell/libertas/if_usb.c   |  3 ---
 .../net/wireless/marvell/libertas_tf/if_usb.c    |  2 --
 drivers/net/wireless/marvell/mwifiex/usb.c       |  4 ----
 drivers/net/wireless/mediatek/mt76/mt7615/usb.c  |  3 ---
 drivers/net/wireless/mediatek/mt76/mt76x0/usb.c  |  3 ---
 drivers/net/wireless/mediatek/mt76/mt76x2/usb.c  |  4 ----
 drivers/net/wireless/mediatek/mt76/mt7921/usb.c  |  2 --
 drivers/net/wireless/mediatek/mt76/mt7925/usb.c  |  2 --
 drivers/net/wireless/mediatek/mt76/mt792x_usb.c  |  1 -
 drivers/net/wireless/mediatek/mt7601u/usb.c      |  3 ---
 drivers/net/wireless/ralink/rt2x00/rt2x00usb.c   | 12 +-----------
 .../net/wireless/realtek/rtl818x/rtl8187/dev.c   |  4 ----
 drivers/net/wireless/realtek/rtl8xxxu/core.c     | 11 +++--------
 drivers/net/wireless/realtek/rtw88/usb.c         |  3 +--
 18 files changed, 15 insertions(+), 82 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v2 01/18] wifi: ath6kl: drop redundant device reference
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 02/18] wifi: ath6kl: rename disconnect callback Johan Hovold
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/ath/ath6kl/usb.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c
index 852e77e41bde..814faf96f1ff 100644
--- a/drivers/net/wireless/ath/ath6kl/usb.c
+++ b/drivers/net/wireless/ath/ath6kl/usb.c
@@ -1124,8 +1124,6 @@ static int ath6kl_usb_probe(struct usb_interface *interface,
 	int vendor_id, product_id;
 	int ret = 0;
 
-	usb_get_dev(dev);
-
 	vendor_id = le16_to_cpu(dev->descriptor.idVendor);
 	product_id = le16_to_cpu(dev->descriptor.idProduct);
 
@@ -1143,11 +1141,8 @@ static int ath6kl_usb_probe(struct usb_interface *interface,
 		ath6kl_dbg(ATH6KL_DBG_USB, "USB 1.1 Host\n");
 
 	ar_usb = ath6kl_usb_create(interface);
-
-	if (ar_usb == NULL) {
-		ret = -ENOMEM;
-		goto err_usb_put;
-	}
+	if (ar_usb == NULL)
+		return -ENOMEM;
 
 	ar = ath6kl_core_create(&ar_usb->udev->dev);
 	if (ar == NULL) {
@@ -1176,15 +1171,12 @@ static int ath6kl_usb_probe(struct usb_interface *interface,
 	ath6kl_core_destroy(ar);
 err_usb_destroy:
 	ath6kl_usb_destroy(ar_usb);
-err_usb_put:
-	usb_put_dev(dev);
 
 	return ret;
 }
 
 static void ath6kl_usb_remove(struct usb_interface *interface)
 {
-	usb_put_dev(interface_to_usbdev(interface));
 	ath6kl_usb_device_detached(interface);
 }
 
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 02/18] wifi: ath6kl: rename disconnect callback
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 01/18] wifi: ath6kl: drop redundant device reference Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 03/18] wifi: ath9k: drop redundant device reference Johan Hovold
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Rename the disconnect callback so that it reflects the callback name for
consistency with the rest of the kernel (e.g. makes it easier to grep
for).

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/ath/ath6kl/usb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c
index 814faf96f1ff..79c18f5ee02b 100644
--- a/drivers/net/wireless/ath/ath6kl/usb.c
+++ b/drivers/net/wireless/ath/ath6kl/usb.c
@@ -1175,7 +1175,7 @@ static int ath6kl_usb_probe(struct usb_interface *interface,
 	return ret;
 }
 
-static void ath6kl_usb_remove(struct usb_interface *interface)
+static void ath6kl_usb_disconnect(struct usb_interface *interface)
 {
 	ath6kl_usb_device_detached(interface);
 }
@@ -1227,7 +1227,7 @@ static struct usb_driver ath6kl_usb_driver = {
 	.probe = ath6kl_usb_probe,
 	.suspend = ath6kl_usb_pm_suspend,
 	.resume = ath6kl_usb_pm_resume,
-	.disconnect = ath6kl_usb_remove,
+	.disconnect = ath6kl_usb_disconnect,
 	.id_table = ath6kl_usb_ids,
 	.supports_autosuspend = true,
 	.disable_hub_initiated_lpm = 1,
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 03/18] wifi: ath9k: drop redundant device reference
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 01/18] wifi: ath6kl: drop redundant device reference Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 02/18] wifi: ath6kl: rename disconnect callback Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-09 11:45   ` Toke Høiland-Jørgensen
  2026-03-06  8:51 ` [PATCH v2 04/18] wifi: ath10k: " Johan Hovold
                   ` (17 subsequent siblings)
  20 siblings, 1 reply; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/ath/ath9k/hif_usb.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 8533b88974b2..821909b81ea9 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -1382,8 +1382,6 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface,
 		goto err_alloc;
 	}
 
-	usb_get_dev(udev);
-
 	hif_dev->udev = udev;
 	hif_dev->interface = interface;
 	hif_dev->usb_device_id = id;
@@ -1403,7 +1401,6 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface,
 err_fw_req:
 	usb_set_intfdata(interface, NULL);
 	kfree(hif_dev);
-	usb_put_dev(udev);
 err_alloc:
 	return ret;
 }
@@ -1451,7 +1448,6 @@ static void ath9k_hif_usb_disconnect(struct usb_interface *interface)
 
 	kfree(hif_dev);
 	dev_info(&udev->dev, "ath9k_htc: USB layer deinitialized\n");
-	usb_put_dev(udev);
 }
 
 #ifdef CONFIG_PM
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 04/18] wifi: ath10k: drop redundant device reference
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (2 preceding siblings ...)
  2026-03-06  8:51 ` [PATCH v2 03/18] wifi: ath9k: drop redundant device reference Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 05/18] wifi: ath10k: rename disconnect callback Johan Hovold
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/ath/ath10k/usb.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/usb.c b/drivers/net/wireless/ath/ath10k/usb.c
index 6661fff326e0..ad1cf0681b19 100644
--- a/drivers/net/wireless/ath/ath10k/usb.c
+++ b/drivers/net/wireless/ath/ath10k/usb.c
@@ -1016,7 +1016,6 @@ static int ath10k_usb_probe(struct usb_interface *interface,
 
 	netif_napi_add(ar->napi_dev, &ar->napi, ath10k_usb_napi_poll);
 
-	usb_get_dev(dev);
 	vendor_id = le16_to_cpu(dev->descriptor.idVendor);
 	product_id = le16_to_cpu(dev->descriptor.idProduct);
 
@@ -1055,8 +1054,6 @@ static int ath10k_usb_probe(struct usb_interface *interface,
 err:
 	ath10k_core_destroy(ar);
 
-	usb_put_dev(dev);
-
 	return ret;
 }
 
@@ -1071,7 +1068,6 @@ static void ath10k_usb_remove(struct usb_interface *interface)
 	ath10k_core_unregister(ar_usb->ar);
 	netif_napi_del(&ar_usb->ar->napi);
 	ath10k_usb_destroy(ar_usb->ar);
-	usb_put_dev(interface_to_usbdev(interface));
 	ath10k_core_destroy(ar_usb->ar);
 }
 
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 05/18] wifi: ath10k: rename disconnect callback
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (3 preceding siblings ...)
  2026-03-06  8:51 ` [PATCH v2 04/18] wifi: ath10k: " Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 06/18] wifi: at76c50x: drop redundant device reference Johan Hovold
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Rename the disconnect callback so that it reflects the callback name for
consistency with the rest of the kernel (e.g. makes it easier to grep
for).

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/ath/ath10k/usb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/usb.c b/drivers/net/wireless/ath/ath10k/usb.c
index ad1cf0681b19..987d57a01ddf 100644
--- a/drivers/net/wireless/ath/ath10k/usb.c
+++ b/drivers/net/wireless/ath/ath10k/usb.c
@@ -1057,7 +1057,7 @@ static int ath10k_usb_probe(struct usb_interface *interface,
 	return ret;
 }
 
-static void ath10k_usb_remove(struct usb_interface *interface)
+static void ath10k_usb_disconnect(struct usb_interface *interface)
 {
 	struct ath10k_usb *ar_usb;
 
@@ -1113,7 +1113,7 @@ static struct usb_driver ath10k_usb_driver = {
 	.probe = ath10k_usb_probe,
 	.suspend = ath10k_usb_pm_suspend,
 	.resume = ath10k_usb_pm_resume,
-	.disconnect = ath10k_usb_remove,
+	.disconnect = ath10k_usb_disconnect,
 	.id_table = ath10k_usb_ids,
 	.supports_autosuspend = true,
 	.disable_hub_initiated_lpm = 1,
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 06/18] wifi: at76c50x: drop redundant device reference
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (4 preceding siblings ...)
  2026-03-06  8:51 ` [PATCH v2 05/18] wifi: ath10k: rename disconnect callback Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 07/18] wifi: libertas: " Johan Hovold
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/atmel/at76c50x-usb.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/atmel/at76c50x-usb.c b/drivers/net/wireless/atmel/at76c50x-usb.c
index 6445332801a4..44b04ea3cc8b 100644
--- a/drivers/net/wireless/atmel/at76c50x-usb.c
+++ b/drivers/net/wireless/atmel/at76c50x-usb.c
@@ -2440,13 +2440,11 @@ static int at76_probe(struct usb_interface *interface,
 	struct mib_fw_version *fwv;
 	int board_type = (int)id->driver_info;
 
-	udev = usb_get_dev(interface_to_usbdev(interface));
+	udev = interface_to_usbdev(interface);
 
 	fwv = kmalloc_obj(*fwv);
-	if (!fwv) {
-		ret = -ENOMEM;
-		goto exit;
-	}
+	if (!fwv)
+		return -ENOMEM;
 
 	/* Load firmware into kernel memory */
 	fwe = at76_load_firmware(udev, board_type);
@@ -2534,8 +2532,7 @@ static int at76_probe(struct usb_interface *interface,
 
 exit:
 	kfree(fwv);
-	if (ret < 0)
-		usb_put_dev(udev);
+
 	return ret;
 }
 
@@ -2552,7 +2549,6 @@ static void at76_disconnect(struct usb_interface *interface)
 
 	wiphy_info(priv->hw->wiphy, "disconnecting\n");
 	at76_delete_device(priv);
-	usb_put_dev(interface_to_usbdev(interface));
 	dev_info(&interface->dev, "disconnected\n");
 }
 
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 07/18] wifi: libertas: drop redundant device reference
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (5 preceding siblings ...)
  2026-03-06  8:51 ` [PATCH v2 06/18] wifi: at76c50x: drop redundant device reference Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 08/18] wifi: libertas_tf: " Johan Hovold
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/marvell/libertas/if_usb.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/wireless/marvell/libertas/if_usb.c b/drivers/net/wireless/marvell/libertas/if_usb.c
index 8a6bf1365cfa..05fcf9cc28fa 100644
--- a/drivers/net/wireless/marvell/libertas/if_usb.c
+++ b/drivers/net/wireless/marvell/libertas/if_usb.c
@@ -276,7 +276,6 @@ static int if_usb_probe(struct usb_interface *intf,
 
 	cardp->boot2_version = udev->descriptor.bcdDevice;
 
-	usb_get_dev(udev);
 	usb_set_intfdata(intf, cardp);
 
 	r = lbs_get_firmware_async(priv, &udev->dev, cardp->model,
@@ -287,7 +286,6 @@ static int if_usb_probe(struct usb_interface *intf,
 	return 0;
 
 err_get_fw:
-	usb_put_dev(udev);
 	lbs_remove_card(priv);
 err_add_card:
 	if_usb_reset_device(cardp);
@@ -321,7 +319,6 @@ static void if_usb_disconnect(struct usb_interface *intf)
 	kfree(cardp);
 
 	usb_set_intfdata(intf, NULL);
-	usb_put_dev(interface_to_usbdev(intf));
 }
 
 /**
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 08/18] wifi: libertas_tf: drop redundant device reference
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (6 preceding siblings ...)
  2026-03-06  8:51 ` [PATCH v2 07/18] wifi: libertas: " Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 09/18] wifi: mwifiex: " Johan Hovold
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/marvell/libertas_tf/if_usb.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/wireless/marvell/libertas_tf/if_usb.c b/drivers/net/wireless/marvell/libertas_tf/if_usb.c
index f49151c18b79..07b38f2b8f58 100644
--- a/drivers/net/wireless/marvell/libertas_tf/if_usb.c
+++ b/drivers/net/wireless/marvell/libertas_tf/if_usb.c
@@ -223,7 +223,6 @@ static int if_usb_probe(struct usb_interface *intf,
 	if (!priv)
 		goto dealloc;
 
-	usb_get_dev(udev);
 	usb_set_intfdata(intf, cardp);
 
 	return 0;
@@ -258,7 +257,6 @@ static void if_usb_disconnect(struct usb_interface *intf)
 	kfree(cardp);
 
 	usb_set_intfdata(intf, NULL);
-	usb_put_dev(interface_to_usbdev(intf));
 
 	lbtf_deb_leave(LBTF_DEB_MAIN);
 }
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 09/18] wifi: mwifiex: drop redundant device reference
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (7 preceding siblings ...)
  2026-03-06  8:51 ` [PATCH v2 08/18] wifi: libertas_tf: " Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 10/18] wifi: mt76: " Johan Hovold
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/marvell/mwifiex/usb.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c
index 947ecb0a7b40..f4b94a1054f6 100644
--- a/drivers/net/wireless/marvell/mwifiex/usb.c
+++ b/drivers/net/wireless/marvell/mwifiex/usb.c
@@ -520,8 +520,6 @@ static int mwifiex_usb_probe(struct usb_interface *intf,
 		return ret;
 	}
 
-	usb_get_dev(udev);
-
 	return 0;
 }
 
@@ -666,8 +664,6 @@ static void mwifiex_usb_disconnect(struct usb_interface *intf)
 	mwifiex_dbg(adapter, FATAL,
 		    "%s: removing card\n", __func__);
 	mwifiex_remove_card(adapter);
-
-	usb_put_dev(interface_to_usbdev(intf));
 }
 
 static void mwifiex_usb_coredump(struct device *dev)
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 10/18] wifi: mt76: drop redundant device reference
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (8 preceding siblings ...)
  2026-03-06  8:51 ` [PATCH v2 09/18] wifi: mwifiex: " Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 11/18] wifi: mt76x0u: " Johan Hovold
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7615/usb.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/usb.c b/drivers/net/wireless/mediatek/mt76/mt7615/usb.c
index d91feffadda9..bab7b91f14be 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/usb.c
@@ -151,7 +151,6 @@ static int mt7663u_probe(struct usb_interface *usb_intf,
 		return -ENOMEM;
 
 	dev = container_of(mdev, struct mt7615_dev, mt76);
-	udev = usb_get_dev(udev);
 	usb_reset_device(udev);
 
 	usb_set_intfdata(usb_intf, dev);
@@ -193,7 +192,6 @@ static int mt7663u_probe(struct usb_interface *usb_intf,
 error:
 	mt76u_queues_deinit(&dev->mt76);
 	usb_set_intfdata(usb_intf, NULL);
-	usb_put_dev(interface_to_usbdev(usb_intf));
 
 	mt76_free_device(&dev->mt76);
 
@@ -211,7 +209,6 @@ static void mt7663u_disconnect(struct usb_interface *usb_intf)
 	mt7663u_cleanup(dev);
 
 	usb_set_intfdata(usb_intf, NULL);
-	usb_put_dev(interface_to_usbdev(usb_intf));
 
 	mt76_free_device(&dev->mt76);
 }
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 11/18] wifi: mt76x0u: drop redundant device reference
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (9 preceding siblings ...)
  2026-03-06  8:51 ` [PATCH v2 10/18] wifi: mt76: " Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 12/18] wifi: mt76x2u: " Johan Hovold
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt76x0/usb.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c b/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c
index 90e5666c0857..2acce121fb14 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c
@@ -245,7 +245,6 @@ static int mt76x0u_probe(struct usb_interface *usb_intf,
 	if (id->driver_info)
 		dev->no_2ghz = true;
 
-	usb_dev = usb_get_dev(usb_dev);
 	usb_reset_device(usb_dev);
 
 	usb_set_intfdata(usb_intf, dev);
@@ -284,7 +283,6 @@ static int mt76x0u_probe(struct usb_interface *usb_intf,
 
 err:
 	usb_set_intfdata(usb_intf, NULL);
-	usb_put_dev(interface_to_usbdev(usb_intf));
 	mt76u_queues_deinit(&dev->mt76);
 	mt76_free_device(&dev->mt76);
 
@@ -303,7 +301,6 @@ static void mt76x0_disconnect(struct usb_interface *usb_intf)
 	mt76x0u_cleanup(dev);
 
 	usb_set_intfdata(usb_intf, NULL);
-	usb_put_dev(interface_to_usbdev(usb_intf));
 
 	mt76_free_device(&dev->mt76);
 }
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 12/18] wifi: mt76x2u: drop redundant device reference
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (10 preceding siblings ...)
  2026-03-06  8:51 ` [PATCH v2 11/18] wifi: mt76x0u: " Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 13/18] wifi: mt76: mt792xu: " Johan Hovold
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt76x2/usb.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
index 01cb3b2830f3..8af360bca643 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
@@ -57,7 +57,6 @@ static int mt76x2u_probe(struct usb_interface *intf,
 
 	dev = container_of(mdev, struct mt76x02_dev, mt76);
 
-	udev = usb_get_dev(udev);
 	usb_reset_device(udev);
 
 	usb_set_intfdata(intf, dev);
@@ -84,14 +83,12 @@ static int mt76x2u_probe(struct usb_interface *intf,
 	mt76u_queues_deinit(&dev->mt76);
 	mt76_free_device(&dev->mt76);
 	usb_set_intfdata(intf, NULL);
-	usb_put_dev(udev);
 
 	return err;
 }
 
 static void mt76x2u_disconnect(struct usb_interface *intf)
 {
-	struct usb_device *udev = interface_to_usbdev(intf);
 	struct mt76x02_dev *dev = usb_get_intfdata(intf);
 	struct ieee80211_hw *hw = mt76_hw(dev);
 
@@ -100,7 +97,6 @@ static void mt76x2u_disconnect(struct usb_interface *intf)
 	mt76x2u_cleanup(dev);
 	mt76_free_device(&dev->mt76);
 	usb_set_intfdata(intf, NULL);
-	usb_put_dev(udev);
 }
 
 static int __maybe_unused mt76x2u_suspend(struct usb_interface *intf,
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 13/18] wifi: mt76: mt792xu: drop redundant device reference
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (11 preceding siblings ...)
  2026-03-06  8:51 ` [PATCH v2 12/18] wifi: mt76x2u: " Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 14/18] wifi: mt7601u: " Johan Hovold
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7921/usb.c | 2 --
 drivers/net/wireless/mediatek/mt76/mt7925/usb.c | 2 --
 drivers/net/wireless/mediatek/mt76/mt792x_usb.c | 1 -
 3 files changed, 5 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/usb.c b/drivers/net/wireless/mediatek/mt76/mt7921/usb.c
index 17057e68bf21..9bfc234f306f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/usb.c
@@ -197,7 +197,6 @@ static int mt7921u_probe(struct usb_interface *usb_intf,
 	dev->fw_features = features;
 	dev->hif_ops = &hif_ops;
 
-	udev = usb_get_dev(udev);
 	usb_reset_device(udev);
 
 	usb_set_intfdata(usb_intf, dev);
@@ -246,7 +245,6 @@ static int mt7921u_probe(struct usb_interface *usb_intf,
 	mt76u_queues_deinit(&dev->mt76);
 
 	usb_set_intfdata(usb_intf, NULL);
-	usb_put_dev(interface_to_usbdev(usb_intf));
 
 	mt76_free_device(&dev->mt76);
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/usb.c b/drivers/net/wireless/mediatek/mt76/mt7925/usb.c
index d9968f03856d..84bcebbf009a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/usb.c
@@ -185,7 +185,6 @@ static int mt7925u_probe(struct usb_interface *usb_intf,
 	dev->fw_features = features;
 	dev->hif_ops = &hif_ops;
 
-	udev = usb_get_dev(udev);
 	usb_reset_device(udev);
 
 	usb_set_intfdata(usb_intf, dev);
@@ -234,7 +233,6 @@ static int mt7925u_probe(struct usb_interface *usb_intf,
 	mt76u_queues_deinit(&dev->mt76);
 
 	usb_set_intfdata(usb_intf, NULL);
-	usb_put_dev(interface_to_usbdev(usb_intf));
 
 	mt76_free_device(&dev->mt76);
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x_usb.c b/drivers/net/wireless/mediatek/mt76/mt792x_usb.c
index 552808458138..f827e8a56a18 100644
--- a/drivers/net/wireless/mediatek/mt76/mt792x_usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt792x_usb.c
@@ -306,7 +306,6 @@ void mt792xu_disconnect(struct usb_interface *usb_intf)
 	mt792xu_cleanup(dev);
 
 	usb_set_intfdata(usb_intf, NULL);
-	usb_put_dev(interface_to_usbdev(usb_intf));
 
 	mt76_free_device(&dev->mt76);
 }
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 14/18] wifi: mt7601u: drop redundant device reference
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (12 preceding siblings ...)
  2026-03-06  8:51 ` [PATCH v2 13/18] wifi: mt76: mt792xu: " Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 15/18] wifi: rt2x00: " Johan Hovold
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/mediatek/mt7601u/usb.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt7601u/usb.c b/drivers/net/wireless/mediatek/mt7601u/usb.c
index c41ae251cb95..9306870cbc91 100644
--- a/drivers/net/wireless/mediatek/mt7601u/usb.c
+++ b/drivers/net/wireless/mediatek/mt7601u/usb.c
@@ -274,7 +274,6 @@ static int mt7601u_probe(struct usb_interface *usb_intf,
 	if (!dev)
 		return -ENOMEM;
 
-	usb_dev = usb_get_dev(usb_dev);
 	usb_reset_device(usb_dev);
 
 	usb_set_intfdata(usb_intf, dev);
@@ -319,7 +318,6 @@ static int mt7601u_probe(struct usb_interface *usb_intf,
 	mt7601u_cleanup(dev);
 err:
 	usb_set_intfdata(usb_intf, NULL);
-	usb_put_dev(interface_to_usbdev(usb_intf));
 
 	destroy_workqueue(dev->stat_wq);
 	ieee80211_free_hw(dev->hw);
@@ -334,7 +332,6 @@ static void mt7601u_disconnect(struct usb_interface *usb_intf)
 	mt7601u_cleanup(dev);
 
 	usb_set_intfdata(usb_intf, NULL);
-	usb_put_dev(interface_to_usbdev(usb_intf));
 
 	destroy_workqueue(dev->stat_wq);
 	ieee80211_free_hw(dev->hw);
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 15/18] wifi: rt2x00: drop redundant device reference
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (13 preceding siblings ...)
  2026-03-06  8:51 ` [PATCH v2 14/18] wifi: mt7601u: " Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 16/18] wifi: rtl818x: " Johan Hovold
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
index 54599cad78f9..83d00b6baf64 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
@@ -802,14 +802,12 @@ int rt2x00usb_probe(struct usb_interface *usb_intf,
 	struct rt2x00_dev *rt2x00dev;
 	int retval;
 
-	usb_dev = usb_get_dev(usb_dev);
 	usb_reset_device(usb_dev);
 
 	hw = ieee80211_alloc_hw(sizeof(struct rt2x00_dev), ops->hw);
 	if (!hw) {
 		rt2x00_probe_err("Failed to allocate hardware\n");
-		retval = -ENOMEM;
-		goto exit_put_device;
+		return -ENOMEM;
 	}
 
 	usb_set_intfdata(usb_intf, hw);
@@ -851,10 +849,6 @@ int rt2x00usb_probe(struct usb_interface *usb_intf,
 
 exit_free_device:
 	ieee80211_free_hw(hw);
-
-exit_put_device:
-	usb_put_dev(usb_dev);
-
 	usb_set_intfdata(usb_intf, NULL);
 
 	return retval;
@@ -873,11 +867,7 @@ void rt2x00usb_disconnect(struct usb_interface *usb_intf)
 	rt2x00usb_free_reg(rt2x00dev);
 	ieee80211_free_hw(hw);
 
-	/*
-	 * Free the USB device data.
-	 */
 	usb_set_intfdata(usb_intf, NULL);
-	usb_put_dev(interface_to_usbdev(usb_intf));
 }
 EXPORT_SYMBOL_GPL(rt2x00usb_disconnect);
 
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 16/18] wifi: rtl818x: drop redundant device reference
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (14 preceding siblings ...)
  2026-03-06  8:51 ` [PATCH v2 15/18] wifi: rt2x00: " Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-16  6:02   ` Ping-Ke Shih
  2026-03-06  8:51 ` [PATCH v2 17/18] wifi: rtl8xxxu: " Johan Hovold
                   ` (4 subsequent siblings)
  20 siblings, 1 reply; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c b/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
index f7e0f6573180..1d21c468a236 100644
--- a/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
@@ -1475,8 +1475,6 @@ static int rtl8187_probe(struct usb_interface *intf,
 	usb_set_intfdata(intf, dev);
 	priv->udev = udev;
 
-	usb_get_dev(udev);
-
 	skb_queue_head_init(&priv->rx_queue);
 
 	BUILD_BUG_ON(sizeof(priv->channels) != sizeof(rtl818x_channels));
@@ -1663,7 +1661,6 @@ static int rtl8187_probe(struct usb_interface *intf,
  err_free_dmabuf:
 	kfree(priv->io_dmabuf);
 	usb_set_intfdata(intf, NULL);
-	usb_put_dev(udev);
  err_free_dev:
 	ieee80211_free_hw(dev);
 	return err;
@@ -1685,7 +1682,6 @@ static void rtl8187_disconnect(struct usb_interface *intf)
 
 	priv = dev->priv;
 	usb_reset_device(priv->udev);
-	usb_put_dev(interface_to_usbdev(intf));
 	kfree(priv->io_dmabuf);
 	ieee80211_free_hw(dev);
 }
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 17/18] wifi: rtl8xxxu: drop redundant device reference
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (15 preceding siblings ...)
  2026-03-06  8:51 ` [PATCH v2 16/18] wifi: rtl818x: " Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-06  8:51 ` [PATCH v2 18/18] wifi: rtw88: fix device leak on probe failure Johan Hovold
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/realtek/rtl8xxxu/core.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/core.c b/drivers/net/wireless/realtek/rtl8xxxu/core.c
index 794187d28caa..f131ca09ae43 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/core.c
@@ -7698,7 +7698,7 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
 	int ret;
 	int untested = 1;
 
-	udev = usb_get_dev(interface_to_usbdev(interface));
+	udev = interface_to_usbdev(interface);
 
 	switch (id->idVendor) {
 	case USB_VENDOR_ID_REALTEK:
@@ -7756,10 +7756,8 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
 	}
 
 	hw = ieee80211_alloc_hw(sizeof(struct rtl8xxxu_priv), &rtl8xxxu_ops);
-	if (!hw) {
-		ret = -ENOMEM;
-		goto err_put_dev;
-	}
+	if (!hw)
+		return -ENOMEM;
 
 	priv = hw->priv;
 	priv->hw = hw;
@@ -7901,8 +7899,6 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
 	mutex_destroy(&priv->h2c_mutex);
 
 	ieee80211_free_hw(hw);
-err_put_dev:
-	usb_put_dev(udev);
 
 	return ret;
 }
@@ -7935,7 +7931,6 @@ static void rtl8xxxu_disconnect(struct usb_interface *interface)
 			 "Device still attached, trying to reset\n");
 		usb_reset_device(priv->udev);
 	}
-	usb_put_dev(priv->udev);
 	ieee80211_free_hw(hw);
 }
 
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 18/18] wifi: rtw88: fix device leak on probe failure
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (16 preceding siblings ...)
  2026-03-06  8:51 ` [PATCH v2 17/18] wifi: rtl8xxxu: " Johan Hovold
@ 2026-03-06  8:51 ` Johan Hovold
  2026-03-06 21:39 ` [PATCH v2 00/18] wifi: drop redundant USB device references Jeff Johnson
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-06  8:51 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold, stable, Sascha Hauer

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

This driver takes a reference to the USB device during probe but does
not to release it on all probe errors (e.g. when descriptor parsing
fails).

Drop the redundant device reference to fix the leak, reduce cargo
culting, make it easier to spot drivers where an extra reference is
needed, and reduce the risk of further memory leaks.

Fixes: a82dfd33d123 ("wifi: rtw88: Add common USB chip support")
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/netdev/2026022319-turbofan-darkened-206d@gregkh/
Cc: stable@vger.kernel.org	# 6.2
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/wireless/realtek/rtw88/usb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
index 433b06c8d8a6..718940ebba31 100644
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
@@ -1041,7 +1041,7 @@ static int rtw_usb_intf_init(struct rtw_dev *rtwdev,
 			     struct usb_interface *intf)
 {
 	struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev);
-	struct usb_device *udev = usb_get_dev(interface_to_usbdev(intf));
+	struct usb_device *udev = interface_to_usbdev(intf);
 	int ret;
 
 	rtwusb->udev = udev;
@@ -1067,7 +1067,6 @@ static void rtw_usb_intf_deinit(struct rtw_dev *rtwdev,
 {
 	struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev);
 
-	usb_put_dev(rtwusb->udev);
 	kfree(rtwusb->usb_data);
 	usb_set_intfdata(intf, NULL);
 }
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: [PATCH v2 00/18] wifi: drop redundant USB device references
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (17 preceding siblings ...)
  2026-03-06  8:51 ` [PATCH v2 18/18] wifi: rtw88: fix device leak on probe failure Johan Hovold
@ 2026-03-06 21:39 ` Jeff Johnson
  2026-03-09  6:27   ` Johannes Berg
  2026-03-10 15:31 ` (subset) " Jeff Johnson
  2026-03-24  8:31 ` Johan Hovold
  20 siblings, 1 reply; 28+ messages in thread
From: Jeff Johnson @ 2026-03-06 21:39 UTC (permalink / raw)
  To: Johan Hovold, linux-wireless, Johannes Berg
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel

On 3/6/2026 12:51 AM, Johan Hovold wrote:
> Driver core holds a reference to the USB interface and its parent USB
> device while the interface is bound to a driver and there is no need to
> take additional references unless the structures are needed after
> disconnect.
> 
> Drop redundant device references to reduce cargo culting, make it easier
> to spot drivers where an extra reference is needed, and reduce the risk
> of memory leaks when drivers fail to release them.
> 
> Note that I sent an ath9k patch separately here:
> 
> 	https://lore.kernel.org/all/20260305105803.17011-1-johan@kernel.org/
> 
> but I included it here in v2 for completeness.
> 
> Also note that Greg had already sent a fix for rtw88 which has been
> picked up by Ping-Ke, but who asked me to send a replacement. If an
> incremental patch is preferred I can instead send a follow up for that
> one later.
> 
> Johan
> 
> 
> Changes in v2:
>  - include ath9k, previously submitted separately
>  - include ath6kl and ath10k
>  - rename the ath6kl and ath10k disconnect callbacks
>  - fix a reference leak in rtw88 previously reported (and fixed
>    differently) by Greg
> 
> 
> Johan Hovold (18):
>   wifi: ath6kl: drop redundant device reference
>   wifi: ath6kl: rename disconnect callback
>   wifi: ath9k: drop redundant device reference
>   wifi: ath10k: drop redundant device reference
>   wifi: ath10k: rename disconnect callback
>   wifi: at76c50x: drop redundant device reference
>   wifi: libertas: drop redundant device reference
>   wifi: libertas_tf: drop redundant device reference
>   wifi: mwifiex: drop redundant device reference
>   wifi: mt76: drop redundant device reference
>   wifi: mt76x0u: drop redundant device reference
>   wifi: mt76x2u: drop redundant device reference
>   wifi: mt76: mt792xu: drop redundant device reference
>   wifi: mt7601u: drop redundant device reference
>   wifi: rt2x00: drop redundant device reference
>   wifi: rtl818x: drop redundant device reference
>   wifi: rtl8xxxu: drop redundant device reference
>   wifi: rtw88: fix device leak on probe failure
> 
>  drivers/net/wireless/ath/ath10k/usb.c            |  8 ++------
>  drivers/net/wireless/ath/ath6kl/usb.c            | 16 ++++------------
>  drivers/net/wireless/ath/ath9k/hif_usb.c         |  4 ----
>  drivers/net/wireless/atmel/at76c50x-usb.c        | 12 ++++--------
>  drivers/net/wireless/marvell/libertas/if_usb.c   |  3 ---
>  .../net/wireless/marvell/libertas_tf/if_usb.c    |  2 --
>  drivers/net/wireless/marvell/mwifiex/usb.c       |  4 ----
>  drivers/net/wireless/mediatek/mt76/mt7615/usb.c  |  3 ---
>  drivers/net/wireless/mediatek/mt76/mt76x0/usb.c  |  3 ---
>  drivers/net/wireless/mediatek/mt76/mt76x2/usb.c  |  4 ----
>  drivers/net/wireless/mediatek/mt76/mt7921/usb.c  |  2 --
>  drivers/net/wireless/mediatek/mt76/mt7925/usb.c  |  2 --
>  drivers/net/wireless/mediatek/mt76/mt792x_usb.c  |  1 -
>  drivers/net/wireless/mediatek/mt7601u/usb.c      |  3 ---
>  drivers/net/wireless/ralink/rt2x00/rt2x00usb.c   | 12 +-----------
>  .../net/wireless/realtek/rtl818x/rtl8187/dev.c   |  4 ----
>  drivers/net/wireless/realtek/rtl8xxxu/core.c     | 11 +++--------
>  drivers/net/wireless/realtek/rtw88/usb.c         |  3 +--
>  18 files changed, 15 insertions(+), 82 deletions(-)
> 

Johannes, will you be taking the entire series via wireless-next?

Or should the individual wireless driver maintainers take their patches
through their individual trees? I'm OK either way.

/jeff

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v2 00/18] wifi: drop redundant USB device references
  2026-03-06 21:39 ` [PATCH v2 00/18] wifi: drop redundant USB device references Jeff Johnson
@ 2026-03-09  6:27   ` Johannes Berg
  2026-03-09 14:25     ` Jeff Johnson
  0 siblings, 1 reply; 28+ messages in thread
From: Johannes Berg @ 2026-03-09  6:27 UTC (permalink / raw)
  To: Jeff Johnson, Johan Hovold, linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel

On Fri, 2026-03-06 at 13:39 -0800, Jeff Johnson wrote:
> 
> Johannes, will you be taking the entire series via wireless-next?
> 
> Or should the individual wireless driver maintainers take their patches
> through their individual trees? I'm OK either way.

So far I took the ones patchwork had auto-assigned to me. I can take
others though, no particular preference, but I guess I already pulled
the series apart anyway.

Let's just say if you want me to take any, assign them to me in
patchwork.

johannes

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v2 03/18] wifi: ath9k: drop redundant device reference
  2026-03-06  8:51 ` [PATCH v2 03/18] wifi: ath9k: drop redundant device reference Johan Hovold
@ 2026-03-09 11:45   ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 28+ messages in thread
From: Toke Høiland-Jørgensen @ 2026-03-09 11:45 UTC (permalink / raw)
  To: Johan Hovold, linux-wireless
  Cc: Jeff Johnson, Brian Norris, Francesco Dolcini, Felix Fietkau,
	Lorenzo Bianconi, Ryder Lee, Shayne Chen, Sean Wang,
	Jakub Kicinski, Stanislaw Gruszka, Hin-Tak Leung, Jes Sorensen,
	Ping-Ke Shih, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Matthias Brugger, AngeloGioacchino Del Regno, Greg Kroah-Hartman,
	libertas-dev, linux-kernel, Johan Hovold

Johan Hovold <johan@kernel.org> writes:

> Driver core holds a reference to the USB interface and its parent USB
> device while the interface is bound to a driver and there is no need to
> take additional references unless the structures are needed after
> disconnect.
>
> Drop the redundant device reference to reduce cargo culting, make it
> easier to spot drivers where an extra reference is needed, and reduce
> the risk of memory leaks when drivers fail to release it.
>
> Signed-off-by: Johan Hovold <johan@kernel.org>

Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v2 00/18] wifi: drop redundant USB device references
  2026-03-09  6:27   ` Johannes Berg
@ 2026-03-09 14:25     ` Jeff Johnson
  0 siblings, 0 replies; 28+ messages in thread
From: Jeff Johnson @ 2026-03-09 14:25 UTC (permalink / raw)
  To: Johannes Berg, Johan Hovold, linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel

On 3/8/2026 11:27 PM, Johannes Berg wrote:
> On Fri, 2026-03-06 at 13:39 -0800, Jeff Johnson wrote:
>>
>> Johannes, will you be taking the entire series via wireless-next?
>>
>> Or should the individual wireless driver maintainers take their patches
>> through their individual trees? I'm OK either way.
> 
> So far I took the ones patchwork had auto-assigned to me. I can take
> others though, no particular preference, but I guess I already pulled
> the series apart anyway.
> 
> Let's just say if you want me to take any, assign them to me in
> patchwork.

ok, then I'll go forward with the ones assigned to me...

/jeff

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: (subset) [PATCH v2 00/18] wifi: drop redundant USB device references
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (18 preceding siblings ...)
  2026-03-06 21:39 ` [PATCH v2 00/18] wifi: drop redundant USB device references Jeff Johnson
@ 2026-03-10 15:31 ` Jeff Johnson
  2026-03-24  8:31 ` Johan Hovold
  20 siblings, 0 replies; 28+ messages in thread
From: Jeff Johnson @ 2026-03-10 15:31 UTC (permalink / raw)
  To: linux-wireless, Johan Hovold
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel


On Fri, 06 Mar 2026 09:51:26 +0100, Johan Hovold wrote:
> Driver core holds a reference to the USB interface and its parent USB
> device while the interface is bound to a driver and there is no need to
> take additional references unless the structures are needed after
> disconnect.
> 
> Drop redundant device references to reduce cargo culting, make it easier
> to spot drivers where an extra reference is needed, and reduce the risk
> of memory leaks when drivers fail to release them.
> 
> [...]

Applied, thanks!

[01/18] wifi: ath6kl: drop redundant device reference
        commit: 86581adf05f526f53b90ebcbbc2fd4d9f9fd4c96
[02/18] wifi: ath6kl: rename disconnect callback
        commit: 0bc013d68a5d1943728d110d759c6587c2b81913
[03/18] wifi: ath9k: drop redundant device reference
        commit: 2ddbec82e1650d57ea0f63d284b5da01d2f21293
[04/18] wifi: ath10k: drop redundant device reference
        commit: c880c0794076f04b0058dd5cbc1f94c33d7bff44
[05/18] wifi: ath10k: rename disconnect callback
        commit: fcc3555fce3c35333891e904c3592375d5e63cf4

Best regards,
-- 
Jeff Johnson <jeff.johnson@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v2 16/18] wifi: rtl818x: drop redundant device reference
  2026-03-06  8:51 ` [PATCH v2 16/18] wifi: rtl818x: " Johan Hovold
@ 2026-03-16  6:02   ` Ping-Ke Shih
  0 siblings, 0 replies; 28+ messages in thread
From: Ping-Ke Shih @ 2026-03-16  6:02 UTC (permalink / raw)
  To: Johan Hovold, linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel, Johan Hovold

Johan Hovold <johan@kernel.org> wrote:

> Driver core holds a reference to the USB interface and its parent USB
> device while the interface is bound to a driver and there is no need to
> take additional references unless the structures are needed after
> disconnect.
> 
> Drop the redundant device reference to reduce cargo culting, make it
> easier to spot drivers where an extra reference is needed, and reduce
> the risk of memory leaks when drivers fail to release it.
> 
> Signed-off-by: Johan Hovold <johan@kernel.org>

3 patch(es) applied to rtw-next branch of rtw.git, thanks.

68e7d359a5ee wifi: rtl818x: drop redundant device reference
711b8add3929 wifi: rtl8xxxu: drop redundant device reference
bbb15e71156c wifi: rtw88: fix device leak on probe failure

---
https://github.com/pkshih/rtw.git


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v2 00/18] wifi: drop redundant USB device references
  2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
                   ` (19 preceding siblings ...)
  2026-03-10 15:31 ` (subset) " Jeff Johnson
@ 2026-03-24  8:31 ` Johan Hovold
  2026-03-24  8:40   ` Ping-Ke Shih
  20 siblings, 1 reply; 28+ messages in thread
From: Johan Hovold @ 2026-03-24  8:31 UTC (permalink / raw)
  To: linux-wireless
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Ping-Ke Shih, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Matthias Brugger,
	AngeloGioacchino Del Regno, Greg Kroah-Hartman, libertas-dev,
	linux-kernel

On Fri, Mar 06, 2026 at 09:51:26AM +0100, Johan Hovold wrote:
> Driver core holds a reference to the USB interface and its parent USB
> device while the interface is bound to a driver and there is no need to
> take additional references unless the structures are needed after
> disconnect.
> 
> Drop redundant device references to reduce cargo culting, make it easier
> to spot drivers where an extra reference is needed, and reduce the risk
> of memory leaks when drivers fail to release them.

> Johan Hovold (18):

>   wifi: mt76: drop redundant device reference
>   wifi: mt76x0u: drop redundant device reference
>   wifi: mt76x2u: drop redundant device reference
>   wifi: mt76: mt792xu: drop redundant device reference
>   wifi: mt7601u: drop redundant device reference

All of these are now in linux-next except for the five Mediatek fixes.

Could someone pick them up as well? Not sure which tree they'd usually
go through.

Johan

^ permalink raw reply	[flat|nested] 28+ messages in thread

* RE: [PATCH v2 00/18] wifi: drop redundant USB device references
  2026-03-24  8:31 ` Johan Hovold
@ 2026-03-24  8:40   ` Ping-Ke Shih
  2026-03-24  8:45     ` Johan Hovold
  0 siblings, 1 reply; 28+ messages in thread
From: Ping-Ke Shih @ 2026-03-24  8:40 UTC (permalink / raw)
  To: Johan Hovold, linux-wireless@vger.kernel.org
  Cc: Jeff Johnson, Toke Høiland-Jørgensen, Brian Norris,
	Francesco Dolcini, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
	Shayne Chen, Sean Wang, Jakub Kicinski, Stanislaw Gruszka,
	Hin-Tak Leung, Jes Sorensen, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Matthias Brugger, AngeloGioacchino Del Regno,
	Greg Kroah-Hartman, libertas-dev@lists.infradead.org,
	linux-kernel@vger.kernel.org

Hi Johan,

Johan Hovold <johan@kernel.org> wrote:
> On Fri, Mar 06, 2026 at 09:51:26AM +0100, Johan Hovold wrote:
> > Driver core holds a reference to the USB interface and its parent USB
> > device while the interface is bound to a driver and there is no need to
> > take additional references unless the structures are needed after
> > disconnect.
> >
> > Drop redundant device references to reduce cargo culting, make it easier
> > to spot drivers where an extra reference is needed, and reduce the risk
> > of memory leaks when drivers fail to release them.
> 
> > Johan Hovold (18):
> 
> >   wifi: mt76: drop redundant device reference
> >   wifi: mt76x0u: drop redundant device reference
> >   wifi: mt76x2u: drop redundant device reference
> >   wifi: mt76: mt792xu: drop redundant device reference
> >   wifi: mt7601u: drop redundant device reference
> 
> All of these are now in linux-next except for the five Mediatek fixes.
> 
> Could someone pick them up as well? Not sure which tree they'd usually
> go through.

  wifi: rtl818x: drop redundant device reference
  wifi: rtl8xxxu: drop redundant device reference
  wifi: rtw88: fix device leak on probe failure

Realtek WiFi got merged into my tree (not in linux-next yet), and I plan to
send pull-request to wireless tree before 7.1 merge window. 

Ping-Ke


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v2 00/18] wifi: drop redundant USB device references
  2026-03-24  8:40   ` Ping-Ke Shih
@ 2026-03-24  8:45     ` Johan Hovold
  0 siblings, 0 replies; 28+ messages in thread
From: Johan Hovold @ 2026-03-24  8:45 UTC (permalink / raw)
  To: Ping-Ke Shih
  Cc: linux-wireless@vger.kernel.org, Jeff Johnson,
	Toke Høiland-Jørgensen, Brian Norris, Francesco Dolcini,
	Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
	Sean Wang, Jakub Kicinski, Stanislaw Gruszka, Hin-Tak Leung,
	Jes Sorensen, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Matthias Brugger, AngeloGioacchino Del Regno, Greg Kroah-Hartman,
	libertas-dev@lists.infradead.org, linux-kernel@vger.kernel.org

On Tue, Mar 24, 2026 at 08:40:10AM +0000, Ping-Ke Shih wrote:
> Johan Hovold <johan@kernel.org> wrote:
> > On Fri, Mar 06, 2026 at 09:51:26AM +0100, Johan Hovold wrote:
> > > Driver core holds a reference to the USB interface and its parent USB
> > > device while the interface is bound to a driver and there is no need to
> > > take additional references unless the structures are needed after
> > > disconnect.
> > >
> > > Drop redundant device references to reduce cargo culting, make it easier
> > > to spot drivers where an extra reference is needed, and reduce the risk
> > > of memory leaks when drivers fail to release them.
> > 
> > > Johan Hovold (18):
> > 
> > >   wifi: mt76: drop redundant device reference
> > >   wifi: mt76x0u: drop redundant device reference
> > >   wifi: mt76x2u: drop redundant device reference
> > >   wifi: mt76: mt792xu: drop redundant device reference
> > >   wifi: mt7601u: drop redundant device reference
> > 
> > All of these are now in linux-next except for the five Mediatek fixes.
> > 
> > Could someone pick them up as well? Not sure which tree they'd usually
> > go through.
> 
>   wifi: rtl818x: drop redundant device reference
>   wifi: rtl8xxxu: drop redundant device reference
>   wifi: rtw88: fix device leak on probe failure
> 
> Realtek WiFi got merged into my tree (not in linux-next yet), and I plan to
> send pull-request to wireless tree before 7.1 merge window. 

Yes, sorry, I forgot to mention that. I got a message about these having
been picked up so I didn't include them in the list above. Thanks.

Johan

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2026-03-24  8:45 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-06  8:51 [PATCH v2 00/18] wifi: drop redundant USB device references Johan Hovold
2026-03-06  8:51 ` [PATCH v2 01/18] wifi: ath6kl: drop redundant device reference Johan Hovold
2026-03-06  8:51 ` [PATCH v2 02/18] wifi: ath6kl: rename disconnect callback Johan Hovold
2026-03-06  8:51 ` [PATCH v2 03/18] wifi: ath9k: drop redundant device reference Johan Hovold
2026-03-09 11:45   ` Toke Høiland-Jørgensen
2026-03-06  8:51 ` [PATCH v2 04/18] wifi: ath10k: " Johan Hovold
2026-03-06  8:51 ` [PATCH v2 05/18] wifi: ath10k: rename disconnect callback Johan Hovold
2026-03-06  8:51 ` [PATCH v2 06/18] wifi: at76c50x: drop redundant device reference Johan Hovold
2026-03-06  8:51 ` [PATCH v2 07/18] wifi: libertas: " Johan Hovold
2026-03-06  8:51 ` [PATCH v2 08/18] wifi: libertas_tf: " Johan Hovold
2026-03-06  8:51 ` [PATCH v2 09/18] wifi: mwifiex: " Johan Hovold
2026-03-06  8:51 ` [PATCH v2 10/18] wifi: mt76: " Johan Hovold
2026-03-06  8:51 ` [PATCH v2 11/18] wifi: mt76x0u: " Johan Hovold
2026-03-06  8:51 ` [PATCH v2 12/18] wifi: mt76x2u: " Johan Hovold
2026-03-06  8:51 ` [PATCH v2 13/18] wifi: mt76: mt792xu: " Johan Hovold
2026-03-06  8:51 ` [PATCH v2 14/18] wifi: mt7601u: " Johan Hovold
2026-03-06  8:51 ` [PATCH v2 15/18] wifi: rt2x00: " Johan Hovold
2026-03-06  8:51 ` [PATCH v2 16/18] wifi: rtl818x: " Johan Hovold
2026-03-16  6:02   ` Ping-Ke Shih
2026-03-06  8:51 ` [PATCH v2 17/18] wifi: rtl8xxxu: " Johan Hovold
2026-03-06  8:51 ` [PATCH v2 18/18] wifi: rtw88: fix device leak on probe failure Johan Hovold
2026-03-06 21:39 ` [PATCH v2 00/18] wifi: drop redundant USB device references Jeff Johnson
2026-03-09  6:27   ` Johannes Berg
2026-03-09 14:25     ` Jeff Johnson
2026-03-10 15:31 ` (subset) " Jeff Johnson
2026-03-24  8:31 ` Johan Hovold
2026-03-24  8:40   ` Ping-Ke Shih
2026-03-24  8:45     ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox