hso: memsetting wrong data in hso_get_count()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 21 Feb 2012 21:30:25 +0000 (21:30 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Feb 2012 20:31:54 +0000 (15:31 -0500)
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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/hso.c

index 304fe78ff60e3b287b608fb4b19bafacb915e315..e1324b4a0f66b42ac9cbf65eb7034a7db3ef9b47 100644 (file)
@@ -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;