aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/class/cdc-acm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 02eb60bb6795..3f1045993474 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -677,7 +677,7 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
677 677
678 /* Perform the closing process and see if we need to do the hardware 678 /* Perform the closing process and see if we need to do the hardware
679 shutdown */ 679 shutdown */
680 if (tty_port_close_start(&acm->port, tty, filp) == 0) 680 if (!acm || tty_port_close_start(&acm->port, tty, filp) == 0)
681 return; 681 return;
682 acm_port_down(acm, 0); 682 acm_port_down(acm, 0);
683 tty_port_close_end(&acm->port, tty); 683 tty_port_close_end(&acm->port, tty);