ChangeSet 1.1315.8.1, 2003/09/16 10:47:50-07:00, greg@kroah.com [PATCH] USB: fix oops when trying to suspend and resume. Thanks to Pavel for the original version of this patch. drivers/usb/core/usb.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c --- a/drivers/usb/core/usb.c Fri Sep 19 17:16:18 2003 +++ b/drivers/usb/core/usb.c Fri Sep 19 17:16:18 2003 @@ -1424,14 +1424,15 @@ struct usb_interface *intf; struct usb_driver *driver; - if ((dev->driver == &usb_generic_driver) || + if ((dev->driver == NULL) || + (dev->driver == &usb_generic_driver) || (dev->driver_data == &usb_generic_driver_data)) return 0; intf = to_usb_interface(dev); driver = to_usb_driver(dev->driver); - if (driver && driver->suspend) + if (driver->suspend) return driver->suspend(intf, state); return 0; } @@ -1441,14 +1442,15 @@ struct usb_interface *intf; struct usb_driver *driver; - if ((dev->driver == &usb_generic_driver) || + if ((dev->driver == NULL) || + (dev->driver == &usb_generic_driver) || (dev->driver_data == &usb_generic_driver_data)) return 0; intf = to_usb_interface(dev); driver = to_usb_driver(dev->driver); - if (driver && driver->resume) + if (driver->resume) return driver->resume(intf); return 0; }