mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 17:13:52 +02:00
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. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a57cdeb369
commit
da54472654
|
|
@ -695,12 +695,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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user