diff options
| author | Henning Meier-Geinitz <henning@meier-geinitz.de> | 2003-07-17 00:46:56 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2003-07-17 00:46:56 -0700 |
| commit | 0a36f1fd435a335ee99bf5cc37590a9ebd4c4e4f (patch) | |
| tree | 368ed367ff5bea30447a1c7333d482e702ae61d4 | |
| parent | cf6c308ad8b56a66f576133169056c71ed3fddf4 (diff) | |
[PATCH] USB: unlink interrupt URBs in scanner driver
Clean up irq urb when not enough memory is available.
| -rw-r--r-- | drivers/usb/image/scanner.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/image/scanner.c b/drivers/usb/image/scanner.c index 946693a9571e..d56c9ab82dc5 100644 --- a/drivers/usb/image/scanner.c +++ b/drivers/usb/image/scanner.c @@ -367,6 +367,7 @@ * 0.4.14 2003-07-15 * - Fixed race between open and probe (Oliver Neukum). * - Added vendor/product ids for Avision, Canon, HP, Microtek and Relisys scanners. + * - Clean up irq urb when not enough memory is available. * * TODO * - Performance @@ -1072,6 +1073,9 @@ probe_scanner(struct usb_interface *intf, /* 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.", intf->minor); + if (have_intr) + usb_unlink_urb(scn->scn_irq); + usb_free_urb(scn->scn_irq); kfree(scn); up(&scn_mutex); return -ENOMEM; @@ -1080,6 +1084,9 @@ probe_scanner(struct usb_interface *intf, if (!(scn->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) { err("probe_scanner(%d): Not enough memory for the input buffer.", intf->minor); + if (have_intr) + usb_unlink_urb(scn->scn_irq); + usb_free_urb(scn->scn_irq); kfree(scn->obuf); kfree(scn); up(&scn_mutex); |
