ChangeSet 1.2042, 2005/02/03 01:37:39-08:00, [EMAIL PROTECTED]

[PATCH] USB: Fix EHCI boot oops on AMD

> > ----- Forwarded message from Andi Kleen <[EMAIL PROTECTED]> -----
> > Someone added an test for AMD 8111 in EHCI, returning
> > an error in reset.
> >
> > When triggered it would cause an NULL pointer oops because
> > it would usb_hcd_put an half initialized hcd without
> > initialized class.  I added a new usb_hcd_free function
> > to handle such half baked objects.

Andi's diagnosis is correct -- the embedded class_device was not fully
initialized -- but the solution is wrong.  The correct patch
is below.  This was clearly my fault, an error in driver-model
programming brought on by lack of documentation about which fields in the
driver-model structures need to be set for which API calls.  (Greg, long
ago I sent you a documentation patch to try and help remedy this problem,
but it seems to have fallen by the wayside.)


Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>


 drivers/usb/core/hcd.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
--- a/drivers/usb/core/hcd.c    2005-02-03 08:45:26 -08:00
+++ b/drivers/usb/core/hcd.c    2005-02-03 08:45:26 -08:00
@@ -676,6 +676,7 @@
        INIT_LIST_HEAD (&bus->bus_list);
 
        class_device_initialize(&bus->class_dev);
+       bus->class_dev.class = &usb_host_class;
 }
 EXPORT_SYMBOL (usb_bus_init);
 
@@ -732,7 +733,6 @@
        }
 
        snprintf(bus->class_dev.class_id, BUS_ID_SIZE, "usb%d", busnum);
-       bus->class_dev.class = &usb_host_class;
        bus->class_dev.dev = bus->controller;
        retval = class_device_add(&bus->class_dev);
        if (retval) {



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to