aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/usb-serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r--drivers/usb/serial/usb-serial.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index a3665659d13..5e1cf78c778 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -1077,16 +1077,17 @@ int usb_serial_suspend(struct usb_interface *intf, pm_message_t message)
1077 struct usb_serial_port *port; 1077 struct usb_serial_port *port;
1078 int i, r = 0; 1078 int i, r = 0;
1079 1079
1080 if (serial) { 1080 if (!serial) /* device has been disconnected */
1081 for (i = 0; i < serial->num_ports; ++i) { 1081 return 0;
1082 port = serial->port[i]; 1082
1083 if (port) 1083 for (i = 0; i < serial->num_ports; ++i) {
1084 kill_traffic(port); 1084 port = serial->port[i];
1085 } 1085 if (port)
1086 kill_traffic(port);
1086 } 1087 }
1087 1088
1088 if (serial->type->suspend) 1089 if (serial->type->suspend)
1089 serial->type->suspend(serial, message); 1090 r = serial->type->suspend(serial, message);
1090 1091
1091 return r; 1092 return r;
1092} 1093}