* [PATCH] ieee802154: atusb: drop redundant device reference
@ 2026-03-05 10:43 Johan Hovold
2026-03-09 8:55 ` Miquel Raynal
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Johan Hovold @ 2026-03-05 10:43 UTC (permalink / raw)
To: Stefan Schmidt
Cc: Alexander Aring, Miquel Raynal, Andrew Lunn, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-wpan, netdev,
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/ieee802154/atusb.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
index 95a4a3cdc8a4..5f7fc4ee7a07 100644
--- a/drivers/net/ieee802154/atusb.c
+++ b/drivers/net/ieee802154/atusb.c
@@ -961,7 +961,7 @@ static int atusb_probe(struct usb_interface *interface,
atusb = hw->priv;
atusb->hw = hw;
- atusb->usb_dev = usb_get_dev(usb_dev);
+ atusb->usb_dev = usb_dev;
usb_set_intfdata(interface, atusb);
atusb->shutdown = 0;
@@ -1055,7 +1055,6 @@ static int atusb_probe(struct usb_interface *interface,
atusb_free_urbs(atusb);
usb_kill_urb(atusb->tx_urb);
usb_free_urb(atusb->tx_urb);
- usb_put_dev(usb_dev);
ieee802154_free_hw(hw);
return ret;
}
@@ -1076,8 +1075,6 @@ static void atusb_disconnect(struct usb_interface *interface)
ieee802154_unregister_hw(atusb->hw);
- usb_put_dev(atusb->usb_dev);
-
ieee802154_free_hw(atusb->hw);
usb_set_intfdata(interface, NULL);
--
2.52.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ieee802154: atusb: drop redundant device reference
2026-03-05 10:43 [PATCH] ieee802154: atusb: drop redundant device reference Johan Hovold
@ 2026-03-09 8:55 ` Miquel Raynal
2026-03-22 22:27 ` Stefan Schmidt
2026-03-24 0:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 6+ messages in thread
From: Miquel Raynal @ 2026-03-09 8:55 UTC (permalink / raw)
To: Johan Hovold
Cc: Stefan Schmidt, Alexander Aring, Andrew Lunn, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-wpan, netdev,
linux-kernel
On 05/03/2026 at 11:43:13 +01, 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>
I'm not qualified enough to judge how useful that can be, but on the
other hand I don't believe it will hurt either, so:
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ieee802154: atusb: drop redundant device reference
2026-03-05 10:43 [PATCH] ieee802154: atusb: drop redundant device reference Johan Hovold
2026-03-09 8:55 ` Miquel Raynal
@ 2026-03-22 22:27 ` Stefan Schmidt
2026-03-22 22:30 ` Stefan Schmidt
2026-03-24 0:50 ` patchwork-bot+netdevbpf
2 siblings, 1 reply; 6+ messages in thread
From: Stefan Schmidt @ 2026-03-22 22:27 UTC (permalink / raw)
To: Johan Hovold
Cc: Alexander Aring, Miquel Raynal, Andrew Lunn, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-wpan, netdev,
linux-kernel
Hello,
On 3/5/26 11:43, 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 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/ieee802154/atusb.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
> index 95a4a3cdc8a4..5f7fc4ee7a07 100644
> --- a/drivers/net/ieee802154/atusb.c
> +++ b/drivers/net/ieee802154/atusb.c
> @@ -961,7 +961,7 @@ static int atusb_probe(struct usb_interface *interface,
>
> atusb = hw->priv;
> atusb->hw = hw;
> - atusb->usb_dev = usb_get_dev(usb_dev);
> + atusb->usb_dev = usb_dev;
> usb_set_intfdata(interface, atusb);
>
> atusb->shutdown = 0;
> @@ -1055,7 +1055,6 @@ static int atusb_probe(struct usb_interface *interface,
> atusb_free_urbs(atusb);
> usb_kill_urb(atusb->tx_urb);
> usb_free_urb(atusb->tx_urb);
> - usb_put_dev(usb_dev);
> ieee802154_free_hw(hw);
> return ret;
> }
> @@ -1076,8 +1075,6 @@ static void atusb_disconnect(struct usb_interface *interface)
>
> ieee802154_unregister_hw(atusb->hw);
>
> - usb_put_dev(atusb->usb_dev);
> -
> ieee802154_free_hw(atusb->hw);
>
> usb_set_intfdata(interface, NULL);
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Jakub, Dave or Paolo can you folks please pick this up into net-next? I
waited a moment but I have nothing else for wpan-next in the queue for
now, so it would be silly to have a pull-request just for this.
regards
Stefan Schmidt
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ieee802154: atusb: drop redundant device reference
2026-03-22 22:27 ` Stefan Schmidt
@ 2026-03-22 22:30 ` Stefan Schmidt
2026-03-23 21:33 ` Jakub Kicinski
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Schmidt @ 2026-03-22 22:30 UTC (permalink / raw)
To: Johan Hovold
Cc: Alexander Aring, Miquel Raynal, Andrew Lunn, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-wpan, netdev,
linux-kernel
Hello again,
On 3/22/26 23:27, Stefan Schmidt wrote:
> Hello,
>
> On 3/5/26 11:43, 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 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/ieee802154/atusb.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/
>> atusb.c
>> index 95a4a3cdc8a4..5f7fc4ee7a07 100644
>> --- a/drivers/net/ieee802154/atusb.c
>> +++ b/drivers/net/ieee802154/atusb.c
>> @@ -961,7 +961,7 @@ static int atusb_probe(struct usb_interface
>> *interface,
>> atusb = hw->priv;
>> atusb->hw = hw;
>> - atusb->usb_dev = usb_get_dev(usb_dev);
>> + atusb->usb_dev = usb_dev;
>> usb_set_intfdata(interface, atusb);
>> atusb->shutdown = 0;
>> @@ -1055,7 +1055,6 @@ static int atusb_probe(struct usb_interface
>> *interface,
>> atusb_free_urbs(atusb);
>> usb_kill_urb(atusb->tx_urb);
>> usb_free_urb(atusb->tx_urb);
>> - usb_put_dev(usb_dev);
>> ieee802154_free_hw(hw);
>> return ret;
>> }
>> @@ -1076,8 +1075,6 @@ static void atusb_disconnect(struct
>> usb_interface *interface)
>> ieee802154_unregister_hw(atusb->hw);
>> - usb_put_dev(atusb->usb_dev);
>> -
>> ieee802154_free_hw(atusb->hw);
>> usb_set_intfdata(interface, NULL);
>
> Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Given that this does not actually go through my tree an Acked-by would
be more appropriate here. Sorry, its late.
Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>
> Jakub, Dave or Paolo can you folks please pick this up into net-next? I
> waited a moment but I have nothing else for wpan-next in the queue for
> now, so it would be silly to have a pull-request just for this.
>
regards
Stefan Schmidt
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ieee802154: atusb: drop redundant device reference
2026-03-22 22:30 ` Stefan Schmidt
@ 2026-03-23 21:33 ` Jakub Kicinski
0 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2026-03-23 21:33 UTC (permalink / raw)
To: Stefan Schmidt
Cc: Johan Hovold, Alexander Aring, Miquel Raynal, Andrew Lunn,
David S . Miller, Eric Dumazet, Paolo Abeni, linux-wpan, netdev,
linux-kernel
On Sun, 22 Mar 2026 23:30:58 +0100 Stefan Schmidt wrote:
> Given that this does not actually go through my tree an Acked-by would
> be more appropriate here. Sorry, its late.
>
> Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>
>
> > Jakub, Dave or Paolo can you folks please pick this up into net-next? I
> > waited a moment but I have nothing else for wpan-next in the queue for
> > now, so it would be silly to have a pull-request just for this.
Will do, thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ieee802154: atusb: drop redundant device reference
2026-03-05 10:43 [PATCH] ieee802154: atusb: drop redundant device reference Johan Hovold
2026-03-09 8:55 ` Miquel Raynal
2026-03-22 22:27 ` Stefan Schmidt
@ 2026-03-24 0:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-24 0:50 UTC (permalink / raw)
To: Johan Hovold
Cc: stefan, alex.aring, miquel.raynal, andrew+netdev, davem, edumazet,
kuba, pabeni, linux-wpan, netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 5 Mar 2026 11:43:13 +0100 you 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.
>
> [...]
Here is the summary with links:
- ieee802154: atusb: drop redundant device reference
https://git.kernel.org/netdev/net-next/c/4e9b1994a105
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-03-24 0:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-05 10:43 [PATCH] ieee802154: atusb: drop redundant device reference Johan Hovold
2026-03-09 8:55 ` Miquel Raynal
2026-03-22 22:27 ` Stefan Schmidt
2026-03-22 22:30 ` Stefan Schmidt
2026-03-23 21:33 ` Jakub Kicinski
2026-03-24 0:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox