diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2021-01-14 18:57:18 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-15 10:21:42 +0100 |
commit | 63e34e707c6248645da340d4aff7714ec27b5fb1 (patch) | |
tree | 92443c03d4fa3b03fff4f9013b1121a21dd2a5db /drivers/tty | |
parent | 6da629c85871a0cb65fad3e0c0a440d64002b0a7 (diff) | |
download | linux-63e34e707c6248645da340d4aff7714ec27b5fb1.tar.bz2 |
tty: vcc: Drop impossible to hit WARN_ON
vcc_get() returns the port that has provided port->index. As the port that
is about to be removed isn't removed yet this trivially will find this
port. So simplify the call to not assign an identical value to the port
pointer and drop the warning that is never hit.
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20210114175718.137483-4-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/vcc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c index d9b0dc6deae9..e2d6205f83ce 100644 --- a/drivers/tty/vcc.c +++ b/drivers/tty/vcc.c @@ -692,12 +692,9 @@ static int vcc_remove(struct vio_dev *vdev) tty_vhangup(port->tty); /* Get exclusive reference to VCC, ensures that there are no other - * clients to this port + * clients to this port. This cannot fail. */ - port = vcc_get(port->index, true); - - if (WARN_ON(!port)) - return -ENODEV; + vcc_get(port->index, true); tty_unregister_device(vcc_tty_driver, port->index); |