diff options
Diffstat (limited to 'drivers/tty/tty_port.c')
-rw-r--r-- | drivers/tty/tty_port.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c index f597e88a705d..c94d2349dd06 100644 --- a/drivers/tty/tty_port.c +++ b/drivers/tty/tty_port.c | |||
@@ -140,6 +140,10 @@ EXPORT_SYMBOL(tty_port_destroy); | |||
140 | static void tty_port_destructor(struct kref *kref) | 140 | static void tty_port_destructor(struct kref *kref) |
141 | { | 141 | { |
142 | struct tty_port *port = container_of(kref, struct tty_port, kref); | 142 | struct tty_port *port = container_of(kref, struct tty_port, kref); |
143 | |||
144 | /* check if last port ref was dropped before tty release */ | ||
145 | if (WARN_ON(port->itty)) | ||
146 | return; | ||
143 | if (port->xmit_buf) | 147 | if (port->xmit_buf) |
144 | free_page((unsigned long)port->xmit_buf); | 148 | free_page((unsigned long)port->xmit_buf); |
145 | tty_port_destroy(port); | 149 | tty_port_destroy(port); |
@@ -480,8 +484,6 @@ int tty_port_close_start(struct tty_port *port, | |||
480 | 484 | ||
481 | if (port->count) { | 485 | if (port->count) { |
482 | spin_unlock_irqrestore(&port->lock, flags); | 486 | spin_unlock_irqrestore(&port->lock, flags); |
483 | if (port->ops->drop) | ||
484 | port->ops->drop(port); | ||
485 | return 0; | 487 | return 0; |
486 | } | 488 | } |
487 | set_bit(ASYNCB_CLOSING, &port->flags); | 489 | set_bit(ASYNCB_CLOSING, &port->flags); |
@@ -500,9 +502,7 @@ int tty_port_close_start(struct tty_port *port, | |||
500 | /* Flush the ldisc buffering */ | 502 | /* Flush the ldisc buffering */ |
501 | tty_ldisc_flush(tty); | 503 | tty_ldisc_flush(tty); |
502 | 504 | ||
503 | /* Don't call port->drop for the last reference. Callers will want | 505 | /* Report to caller this is the last port reference */ |
504 | to drop the last active reference in ->shutdown() or the tty | ||
505 | shutdown path */ | ||
506 | return 1; | 506 | return 1; |
507 | } | 507 | } |
508 | EXPORT_SYMBOL(tty_port_close_start); | 508 | EXPORT_SYMBOL(tty_port_close_start); |