Hi,
Clean up irq urb when not enough memory is available (Sergey Vlasov).
Bye,
Henning
--- linux-2.4.22-pre6.nofreeze/drivers/usb/scanner.c 2003-07-15 18:31:26.000000000
+0200
+++ linux-2.4.22-pre6.irq-cleanup/drivers/usb/scanner.c 2003-07-17 17:56:41.000000000
+0200
@@ -376,6 +376,7 @@
* check for scn->present. This avoids crashing when someone writes (reads) to
* the device while it's already disconnected but still open. Patch from
* Sergey Vlasov.
+ * - Clean up irq urb when not enough memory is available (Sergey Vlasov).
*
* TODO
* - Performance
@@ -1040,6 +1041,8 @@
/* Ok, now initialize all the relevant values */
if (!(scn->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) {
err("probe_scanner(%d): Not enough memory for the output buffer.",
scn_minor);
+ if (have_intr)
+ usb_unlink_urb(&scn->scn_irq);
kfree(scn);
up(&scn_mutex);
return NULL;
@@ -1048,6 +1051,8 @@
if (!(scn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) {
err("probe_scanner(%d): Not enough memory for the input buffer.",
scn_minor);
+ if (have_intr)
+ usb_unlink_urb(&scn->scn_irq);
kfree(scn->obuf);
kfree(scn);
up(&scn_mutex);
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel