[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230427133350.31064-5-oneukum@suse.com>
Date: Thu, 27 Apr 2023 15:33:46 +0200
From: Oliver Neukum <oneukum@...e.com>
To: wim@...ux-watchdog.org, linux@...ck-us.net,
linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Oliver Neukum <oneukum@...e.com>
Subject: [PATCH 4/8] pcwd_usb: do not leave a freed URB active
Fix disconnect so that the URB is killed.
Not doing so leaves this to error handling
in the case of physical disconnect.
This fixes the case of a soft disconnect
and prevents multiple accesses to freed
memory.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Oliver Neukum <oneukum@...e.com>
---
drivers/watchdog/pcwd_usb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
index ed3be8926a15..fe58ec84ce8c 100644
--- a/drivers/watchdog/pcwd_usb.c
+++ b/drivers/watchdog/pcwd_usb.c
@@ -815,6 +815,7 @@ static void usb_pcwd_disconnect(struct usb_interface *interface)
/* We should now stop communicating with the USB PCWD device */
usb_pcwd->exists = 0;
+ usb_kill_urb(usb_pcwd->intr_urb);
/* Deregister */
misc_deregister(&usb_pcwd_miscdev);
--
2.40.0
Powered by blists - more mailing lists