USB: usb_serial_resume bug fix
authorSarah Sharp <sarah.a.sharp@intel.com>
Thu, 25 Oct 2007 17:58:43 +0000 (10:58 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 25 Oct 2007 19:18:45 +0000 (12:18 -0700)
Avoid potential null pointer dereference.

Signed-off-by: Sarah Sharp <sarah.a.sharp@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/usb-serial.c

index 426afaa0d9b8b13429b38b358772cdbfdd556c9f..497e29a700ca8dccb20049e0aa0abf983dcbf40c 100644 (file)
@@ -1123,7 +1123,9 @@ int usb_serial_resume(struct usb_interface *intf)
 {
        struct usb_serial *serial = usb_get_intfdata(intf);
 
-       return serial->type->resume(serial);
+       if (serial->type->resume)
+               return serial->type->resume(serial);
+       return 0;
 }
 EXPORT_SYMBOL(usb_serial_resume);