diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-12 20:32:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-12 20:32:21 -0400 |
commit | 3ee4b889a0708e6503dca0f771c2d84f56602a18 (patch) | |
tree | 92c8ea1beb4b618f5e92e3bd809b31f37efb566d /drivers | |
parent | 7258ea8acd2252d5a68e7dfa2eac8dc8f364b91e (diff) | |
parent | 3e2aac366f40f4cf4f3b1d9101b27f703998dfbc (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6:
USB: Fix unload oops and memory leak in yealink driver
usbserial: Reference leak
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/input/yealink.c | 12 | ||||
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/drivers/usb/input/yealink.c b/drivers/usb/input/yealink.c index 575a4e672e96..7b45fd3de911 100644 --- a/drivers/usb/input/yealink.c +++ b/drivers/usb/input/yealink.c | |||
@@ -810,12 +810,9 @@ static int usb_cleanup(struct yealink_dev *yld, int err) | |||
810 | if (yld == NULL) | 810 | if (yld == NULL) |
811 | return err; | 811 | return err; |
812 | 812 | ||
813 | if (yld->urb_irq) { | 813 | usb_kill_urb(yld->urb_irq); /* parameter validation in core/urb */ |
814 | usb_kill_urb(yld->urb_irq); | 814 | usb_kill_urb(yld->urb_ctl); /* parameter validation in core/urb */ |
815 | usb_free_urb(yld->urb_irq); | 815 | |
816 | } | ||
817 | if (yld->urb_ctl) | ||
818 | usb_free_urb(yld->urb_ctl); | ||
819 | if (yld->idev) { | 816 | if (yld->idev) { |
820 | if (err) | 817 | if (err) |
821 | input_free_device(yld->idev); | 818 | input_free_device(yld->idev); |
@@ -831,6 +828,9 @@ static int usb_cleanup(struct yealink_dev *yld, int err) | |||
831 | if (yld->irq_data) | 828 | if (yld->irq_data) |
832 | usb_buffer_free(yld->udev, USB_PKT_LEN, | 829 | usb_buffer_free(yld->udev, USB_PKT_LEN, |
833 | yld->irq_data, yld->irq_dma); | 830 | yld->irq_data, yld->irq_dma); |
831 | |||
832 | usb_free_urb(yld->urb_irq); /* parameter validation in core/urb */ | ||
833 | usb_free_urb(yld->urb_ctl); /* parameter validation in core/urb */ | ||
834 | kfree(yld); | 834 | kfree(yld); |
835 | return err; | 835 | return err; |
836 | } | 836 | } |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 12c1694d322e..e06a41bd0f3b 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -464,8 +464,10 @@ static int serial_read_proc (char *page, char **start, off_t off, int count, int | |||
464 | length += sprintf (page+length, " path:%s", tmp); | 464 | length += sprintf (page+length, " path:%s", tmp); |
465 | 465 | ||
466 | length += sprintf (page+length, "\n"); | 466 | length += sprintf (page+length, "\n"); |
467 | if ((length + begin) > (off + count)) | 467 | if ((length + begin) > (off + count)) { |
468 | usb_serial_put(serial); | ||
468 | goto done; | 469 | goto done; |
470 | } | ||
469 | if ((length + begin) < off) { | 471 | if ((length + begin) < off) { |
470 | begin += length; | 472 | begin += length; |
471 | length = 0; | 473 | length = 0; |