Skip to content

Commit

Permalink
usb/isp1760: Fix crash when unplugging bug
Browse files Browse the repository at this point in the history
This fixes a problem with my previous patch series where there's a great
risk that the kernel will crash when unplugging interrupt devices from
the USB port. These lines must have got missing when I rebased the
patches from the older kernel I was working with to 2.6.37 and 2.6-next:

This fixes a bug where the kernel may crash if you unplug a USB device
that has active interrupt transfers.

Signed-off-by: Arvid Brodin <arvid.brodin@enea.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Arvid Brodin authored and Greg Kroah-Hartman committed Mar 7, 2011
1 parent 9b37596 commit d3cf2a8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/usb/host/isp1760-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1624,14 +1624,14 @@ static int isp1760_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)

ptd_write(hcd->regs, reg_base, i, &ptd);

qtd = ints->qtd;
qtd = ints[i].qtd;
qh = ints[i].qh;

free_mem(hcd, qtd);
qtd = clean_up_qtdlist(qtd, qh);

ints->qh = NULL;
ints->qtd = NULL;
ints[i].qh = NULL;
ints[i].qtd = NULL;

isp1760_urb_done(hcd, urb);
if (qtd)
Expand All @@ -1655,7 +1655,6 @@ static int isp1760_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
if (!qtd)
break;
}
ints++;
}

spin_unlock_irqrestore(&priv->lock, flags);
Expand Down

0 comments on commit d3cf2a8

Please sign in to comment.