Browse Source

USB: usb_serial_resume bug fix

Avoid potential null pointer dereference.

Signed-off-by: Sarah Sharp <sarah.a.sharp@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sarah Sharp 17 years ago
parent
commit
8abaee238e
1 changed files with 3 additions and 1 deletions
  1. 3 1
      drivers/usb/serial/usb-serial.c

+ 3 - 1
drivers/usb/serial/usb-serial.c

@@ -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);