diff options
Diffstat (limited to 'include/linux/tty.h')
| -rw-r--r-- | include/linux/tty.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index b90b5c221ff0..1c3316a47d7e 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 | ||
| 519 | static inline struct tty_port *tty_port_get(struct tty_port *port) | 519 | static 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. */ |
