diff options
author | Tyrel Datwyler <tyreld@linux.ibm.com> | 2020-08-20 18:46:38 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-29 09:07:04 +0100 |
commit | 171408e8ed00ab6e2761e9af78737ecd31a46e1f (patch) | |
tree | 0464e4cd6e3037686840689748be9381d2f2ffce /drivers/pwm/pwm-lpss.c | |
parent | ee042abcf6398bf6948872f93e45c2d9abf0c675 (diff) | |
download | linux-stable-171408e8ed00ab6e2761e9af78737ecd31a46e1f.tar.gz linux-stable-171408e8ed00ab6e2761e9af78737ecd31a46e1f.tar.bz2 linux-stable-171408e8ed00ab6e2761e9af78737ecd31a46e1f.zip |
tty: hvcs: Don't NULL tty->driver_data until hvcs_cleanup()
[ Upstream commit 63ffcbdad738e3d1c857027789a2273df3337624 ]
The code currently NULLs tty->driver_data in hvcs_close() with the
intent of informing the next call to hvcs_open() that device needs to be
reconfigured. However, when hvcs_cleanup() is called we copy hvcsd from
tty->driver_data which was previoulsy NULLed by hvcs_close() and our
call to tty_port_put(&hvcsd->port) doesn't actually do anything since
&hvcsd->port ends up translating to NULL by chance. This has the side
effect that when hvcs_remove() is called we have one too many port
references preventing hvcs_destuct_port() from ever being called. This
also prevents us from reusing the /dev/hvcsX node in a future
hvcs_probe() and we can eventually run out of /dev/hvcsX devices.
Fix this by waiting to NULL tty->driver_data in hvcs_cleanup().
Fixes: 27bf7c43a19c ("TTY: hvcs, add tty install")
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Link: https://lore.kernel.org/r/20200820234643.70412-1-tyreld@linux.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/pwm/pwm-lpss.c')
0 files changed, 0 insertions, 0 deletions