diff options
author | Johan Hovold <johan@kernel.org> | 2020-02-10 15:57:30 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-02-28 16:38:49 +0100 |
commit | c9ca2010202b3dd9a7a4e27c2192ee8df3e87a2e (patch) | |
tree | aa1cf22b9b6882564165c289dee1c655085974d6 /include | |
parent | 463a3db812d9069b91d088f13b961239169a7a81 (diff) | |
download | linux-stable-c9ca2010202b3dd9a7a4e27c2192ee8df3e87a2e.tar.gz linux-stable-c9ca2010202b3dd9a7a4e27c2192ee8df3e87a2e.tar.bz2 linux-stable-c9ca2010202b3dd9a7a4e27c2192ee8df3e87a2e.zip |
serdev: ttyport: restore client ops on deregistration
commit 0c5aae59270fb1f827acce182786094c9ccf598e upstream.
The serdev tty-port controller driver should reset the tty-port client
operations also on deregistration to avoid a NULL-pointer dereference in
case the port is later re-registered as a normal tty device.
Note that this can only happen with tty drivers such as 8250 which have
statically allocated port structures that can end up being reused and
where a later registration would not register a serdev controller (e.g.
due to registration errors or if the devicetree has been changed in
between).
Specifically, this can be an issue for any statically defined ports that
would be registered by 8250 core when an 8250 driver is being unbound.
Fixes: bed35c6dfa6a ("serdev: add a tty port controller driver")
Cc: stable <stable@vger.kernel.org> # 4.11
Reported-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20200210145730.22762-1-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/tty.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index 76db046f09ab..248a137112e8 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -225,6 +225,8 @@ struct tty_port_client_operations { void (*write_wakeup)(struct tty_port *port); }; +extern const struct tty_port_client_operations tty_port_default_client_ops; + struct tty_port { struct tty_bufhead buf; /* Locked internally */ struct tty_struct *tty; /* Back pointer */ |