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

Commit add477df authored by Olivier Blin's avatar Olivier Blin Committed by Jeff Garzik
Browse files

hso: fix oops in read/write callbacks



The tty may be closed already when the read/write callbacks are called.
This patch checks that the ttys still exist before waking them up.

Signed-off-by: default avatarOlivier Blin <blino@mandriva.com>
Acked-by: default avatarAlan Cox <alan@redhat.com>
Cc: Jari Tenhunen <jari.tenhunen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 1595ab5d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1467,6 +1467,7 @@ static void hso_std_serial_write_bulk_callback(struct urb *urb)
		return;
	}
	hso_put_activity(serial->parent);
	if (serial->tty)
		tty_wakeup(serial->tty);
	hso_kick_transmit(serial);

@@ -1538,6 +1539,7 @@ static void ctrl_callback(struct urb *urb)
			clear_bit(HSO_SERIAL_FLAG_RX_SENT, &serial->flags);
	} else {
		hso_put_activity(serial->parent);
		if (serial->tty)
			tty_wakeup(serial->tty);
		/* response to a write command */
		hso_kick_transmit(serial);