lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Sun,  1 Oct 2006 00:33:38 +0200 (CEST)
From:	Jiri Slaby <jirislaby@...il.com>
To:	Andrew Morton <akpm@...l.org>
Cc:	<linux-kernel@...r.kernel.org>, <support@...a.com.tw>
Subject: [PATCH 1/4] Char: mxser_new, kill unneeded memsets

mxser_new, kill unneeded memsets

There is no need to re-zero static global variables' memory, hence memsets
doing this are useless.
alloc_tty_struct also zeroes allocated memory: another candidate for
removing.
This fixes also a bug -- global structures are cleaned up after
initialization of some its parts.

Signed-off-by: Jiri Slaby <jirislaby@...il.com>

---
commit e3d57eae41e172fbd6195a78532f3325b2441450
tree b1c17a897e53fa8fa217f1ea809659b9ff462718
parent 309f84ccd85a12c363b7ceb60139bcf2fabefbd7
author Jiri Slaby <jirislaby@...il.com> Sat, 30 Sep 2006 00:10:08 +0200
committer Jiri Slaby <xslaby@...moi.localdomain> Sat, 30 Sep 2006 00:10:08 +0200

 drivers/char/mxser_new.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c
index f93d438..1a6a3aa 100644
--- a/drivers/char/mxser_new.c
+++ b/drivers/char/mxser_new.c
@@ -697,7 +697,6 @@ static int mxser_init(void)
 		MXSER_VERSION);
 
 	/* Initialize the tty_driver structure */
-	memset(mxvar_sdriver, 0, sizeof(struct tty_driver));
 	mxvar_sdriver->magic = TTY_DRIVER_MAGIC;
 	mxvar_sdriver->name = "ttyM";
 	mxvar_sdriver->major = ttymajor;
@@ -714,12 +713,6 @@ static int mxser_init(void)
 	mxvar_sdriver->termios_locked = mxvar_termios_locked;
 
 	mxvar_diagflag = 0;
-	memset(mxser_boards, 0, sizeof(mxser_boards));
-	memset(&mxvar_log, 0, sizeof(struct mxser_log));
-
-	memset(&mxser_msr, 0, sizeof(unsigned char) * (MXSER_PORTS + 1));
-	memset(&mon_data_ext, 0, sizeof(struct mxser_mon_ext));
-	memset(&mxser_set_baud_method, 0, sizeof(int) * (MXSER_PORTS + 1));
 
 	m = 0;
 	/* Start finding ISA boards here */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ