Skip to content

Commit

Permalink
tty: vcc: Drop impossible to hit WARN_ON
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Uwe Kleine-König authored and gregkh committed Jan 15, 2021
1 parent 6da629c commit 63e34e7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/tty/vcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 63e34e7

Please sign in to comment.