ChangeSet 1.855.9.9, 2002/11/05 11:08:14-08:00, david-b@pacbell.net [PATCH] ohci-hcd, remove oops and... Two changes, one big one not: - check before traversing a null pointer, removing oops - always do bandwidth checks, no point in allowing overcommit That oops possibility has been there for a bit over two months, but something changed recently which made me see it. Maybe sme other folk have seen this one too (in ed_deschedule). diff -Nru a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c --- a/drivers/usb/host/ohci-q.c Tue Nov 5 16:10:29 2002 +++ b/drivers/usb/host/ohci-q.c Tue Nov 5 16:10:29 2002 @@ -83,7 +83,7 @@ */ for (i = 0; i < interval ; i++) { if (branch < 0 || ohci->load [branch] > ohci->load [i]) { -#ifdef CONFIG_USB_BANDWIDTH +#if 1 /* CONFIG_USB_BANDWIDTH */ int j; /* usb 1.1 says 90% of one frame */ @@ -276,7 +276,7 @@ ohci->ed_controltail = ed->ed_prev; if (ohci->ed_controltail) ohci->ed_controltail->ed_next = 0; - } else { + } else if (ed->ed_next) { ed->ed_next->ed_prev = ed->ed_prev; } break; @@ -297,7 +297,7 @@ ohci->ed_bulktail = ed->ed_prev; if (ohci->ed_bulktail) ohci->ed_bulktail->ed_next = 0; - } else { + } else if (ed->ed_next) { ed->ed_next->ed_prev = ed->ed_prev; } break;