Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Linus Torvalds committed Sep 13, 2006
2 parents 7258ea8 + 3e2aac3 commit 3ee4b88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions drivers/usb/input/yealink.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,12 +810,9 @@ static int usb_cleanup(struct yealink_dev *yld, int err)
if (yld == NULL)
return err;

if (yld->urb_irq) {
usb_kill_urb(yld->urb_irq);
usb_free_urb(yld->urb_irq);
}
if (yld->urb_ctl)
usb_free_urb(yld->urb_ctl);
usb_kill_urb(yld->urb_irq); /* parameter validation in core/urb */
usb_kill_urb(yld->urb_ctl); /* parameter validation in core/urb */

if (yld->idev) {
if (err)
input_free_device(yld->idev);
Expand All @@ -831,6 +828,9 @@ static int usb_cleanup(struct yealink_dev *yld, int err)
if (yld->irq_data)
usb_buffer_free(yld->udev, USB_PKT_LEN,
yld->irq_data, yld->irq_dma);

usb_free_urb(yld->urb_irq); /* parameter validation in core/urb */
usb_free_urb(yld->urb_ctl); /* parameter validation in core/urb */
kfree(yld);
return err;
}
Expand Down
4 changes: 3 additions & 1 deletion drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,10 @@ static int serial_read_proc (char *page, char **start, off_t off, int count, int
length += sprintf (page+length, " path:%s", tmp);

length += sprintf (page+length, "\n");
if ((length + begin) > (off + count))
if ((length + begin) > (off + count)) {
usb_serial_put(serial);
goto done;
}
if ((length + begin) < off) {
begin += length;
length = 0;
Expand Down

0 comments on commit 3ee4b88

Please sign in to comment.