* [PATCH] gpib: lpvo_usb: fix memory leak on disconnect
@ 2026-03-10 10:51 Johan Hovold
2026-03-30 11:48 ` Johan Hovold
0 siblings, 1 reply; 2+ messages in thread
From: Johan Hovold @ 2026-03-10 10:51 UTC (permalink / raw)
To: Dave Penkler; +Cc: Greg Kroah-Hartman, linux-kernel, Johan Hovold, stable
The driver iterates over the registered USB interfaces during GPIB
attach and takes a reference to their USB devices until a match is
found. These references are never released which leads to a memory leak
when devices are disconnected.
Fix the leak by dropping the unnecessary references.
Fixes: fce79512a96a ("staging: gpib: Add LPVO DIY USB GPIB driver")
Cc: stable@vger.kernel.org # 6.13
Cc: Dave Penkler <dpenkler@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
index 389dde5a8481..e6ea9422d6f2 100644
--- a/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
+++ b/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
@@ -402,7 +402,7 @@ static int usb_gpib_attach(struct gpib_board *board, const struct gpib_board_con
for (j = 0 ; j < MAX_DEV ; j++) {
if ((assigned_usb_minors & 1 << j) == 0)
continue;
- udev = usb_get_dev(interface_to_usbdev(lpvo_usb_interfaces[j]));
+ udev = interface_to_usbdev(lpvo_usb_interfaces[j]);
device_path = kobject_get_path(&udev->dev.kobj, GFP_KERNEL);
match = gpib_match_device_path(&lpvo_usb_interfaces[j]->dev,
config->device_path);
@@ -417,7 +417,7 @@ static int usb_gpib_attach(struct gpib_board *board, const struct gpib_board_con
for (j = 0 ; j < MAX_DEV ; j++) {
if ((assigned_usb_minors & 1 << j) == 0)
continue;
- udev = usb_get_dev(interface_to_usbdev(lpvo_usb_interfaces[j]));
+ udev = interface_to_usbdev(lpvo_usb_interfaces[j]);
DIA_LOG(1, "dev. %d: bus %d -> %d dev: %d -> %d\n", j,
udev->bus->busnum, config->pci_bus, udev->devnum, config->pci_slot);
if (config->pci_bus == udev->bus->busnum &&
--
2.52.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] gpib: lpvo_usb: fix memory leak on disconnect
2026-03-10 10:51 [PATCH] gpib: lpvo_usb: fix memory leak on disconnect Johan Hovold
@ 2026-03-30 11:48 ` Johan Hovold
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hovold @ 2026-03-30 11:48 UTC (permalink / raw)
To: Dave Penkler; +Cc: Greg Kroah-Hartman, linux-kernel, stable
On Tue, Mar 10, 2026 at 11:51:27AM +0100, Johan Hovold wrote:
> The driver iterates over the registered USB interfaces during GPIB
> attach and takes a reference to their USB devices until a match is
> found. These references are never released which leads to a memory leak
> when devices are disconnected.
>
> Fix the leak by dropping the unnecessary references.
>
> Fixes: fce79512a96a ("staging: gpib: Add LPVO DIY USB GPIB driver")
> Cc: stable@vger.kernel.org # 6.13
> Cc: Dave Penkler <dpenkler@gmail.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
Can this one be picked up for 7.1?
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-30 11:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10 10:51 [PATCH] gpib: lpvo_usb: fix memory leak on disconnect Johan Hovold
2026-03-30 11:48 ` Johan Hovold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox