Skip to content

Commit

Permalink
hso: memsetting wrong data in hso_get_count()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Feb 22, 2012
1 parent 5d38b1f commit 22ad749
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/usb/hso.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 22ad749

Please sign in to comment.