Sfoglia il codice sorgente

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 anni fa
parent
commit
8abaee238e
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  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);