aboutsummaryrefslogtreecommitdiff
path: root/include/linux/tty.h
diff options
context:
space:
mode:
authorJohn W. Linville <[email protected]>2014-02-24 15:04:35 -0500
committerJohn W. Linville <[email protected]>2014-02-24 15:04:35 -0500
commitdb18014f65f62879e70be55898be3fd68a3363a8 (patch)
tree90d5e33852753f43d76d25f8d22a64a9e5bd94e8 /include/linux/tty.h
parentc77986c78aa941af8266272841567e78b72d54cc (diff)
parent668b7b19820b0801c425d31cc27fd6f499050e5c (diff)
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
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);
static inline struct tty_port *tty_port_get(struct tty_port *port)
{
- if (port)
- kref_get(&port->kref);
- return port;
+ if (port && kref_get_unless_zero(&port->kref))
+ return port;
+ return NULL;
}
/* If the cts flow control is enabled, return true. */