netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] hso: memsetting wrong data in hso_get_count()
@ 2012-02-22  7:30 Dan Carpenter
  2012-02-22 20:32 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-02-22  7:30 UTC (permalink / raw)
  To: Jan Dumon
  Cc: Greg Kroah-Hartman, linux-usb, netdev, David S. Miller,
	kernel-janitors

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>

diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 304fe78..e1324b4 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-22 20:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-22  7:30 [patch] hso: memsetting wrong data in hso_get_count() Dan Carpenter
2012-02-22 20:32 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).