aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tty.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r--include/linux/tty.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 90b4fdc8a61f..4781d7b27dd3 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -518,9 +518,9 @@ extern void tty_port_put(struct tty_port *port);
518 518
519static inline struct tty_port *tty_port_get(struct tty_port *port) 519static inline struct tty_port *tty_port_get(struct tty_port *port)
520{ 520{
521 if (port) 521 if (port && kref_get_unless_zero(&port->kref))
522 kref_get(&port->kref); 522 return port;
523 return port; 523 return NULL;
524} 524}
525 525
526/* If the cts flow control is enabled, return true. */ 526/* If the cts flow control is enabled, return true. */