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

Commit 22ad7499 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller
Browse files

hso: memsetting wrong data in hso_get_count()



The intent was to clear out the icount struct here, but we accidentally
clear stack memory instead.  It probably will lead to a NULL dereference
right away.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5d38b1f8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1632,7 +1632,7 @@ static int hso_get_count(struct tty_struct *tty,
	struct hso_serial *serial = get_serial_by_tty(tty);
	struct hso_tiocmget  *tiocmget = serial->tiocmget;

	memset(&icount, 0, sizeof(struct serial_icounter_struct));
	memset(icount, 0, sizeof(struct serial_icounter_struct));

	if (!tiocmget)
		 return -ENOENT;