Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60e5e0b8 authored by Amit Shah's avatar Amit Shah Committed by Rusty Russell
Browse files

virtio: console: Fix crash when port is unplugged and blocked for write



When a program that has a virtio port opened and blocked for a write
operation, a port hot-unplug event will later led to a crash when
SIGTERM was sent to the program. Fix that.

Signed-off-by: default avatarAmit Shah <amit.shah@redhat.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 0047634d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -529,6 +529,10 @@ static bool will_write_block(struct port *port)
{
	bool ret;

	if (!port->guest_connected) {
		/* Port got hot-unplugged. Let's exit. */
		return false;
	}
	if (!port->host_connected)
		return true;