Skip to content

Commit 63e34e7

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
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 <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 6da629c commit 63e34e7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/tty/vcc.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -692,12 +692,9 @@ static int vcc_remove(struct vio_dev *vdev)
692692
tty_vhangup(port->tty);
693693

694694
/* Get exclusive reference to VCC, ensures that there are no other
695-
* clients to this port
695+
* clients to this port. This cannot fail.
696696
*/
697-
port = vcc_get(port->index, true);
698-
699-
if (WARN_ON(!port))
700-
return -ENODEV;
697+
vcc_get(port->index, true);
701698

702699
tty_unregister_device(vcc_tty_driver, port->index);
703700

0 commit comments

Comments
 (0)