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]
Message-Id: <1f2c6fee2d755879872b5fdd5f81d9f23569ffdd.1288925425.git.joe@perches.com>
Date:	Thu,  4 Nov 2010 20:08:06 -0700
From:	Joe Perches <joe@...ches.com>
To:	Jiri Kosina <trivial@...nel.org>
Cc:	Jan Harkes <jaharkes@...cmu.edu>, coda@...cmu.edu,
	codalist@...a.cs.cmu.edu, linux-kernel@...r.kernel.org
Subject: [PATCH 42/49] include/linux/coda_linux.h: Use vzalloc

Signed-off-by: Joe Perches <joe@...ches.com>
---
 include/linux/coda_linux.h |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index 2e914d0..57460f3 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -55,19 +55,25 @@ unsigned short coda_flags_to_cflags(unsigned short);
 void coda_sysctl_init(void);
 void coda_sysctl_clean(void);
 
-#define CODA_ALLOC(ptr, cast, size) do { \
-    if (size < PAGE_SIZE) \
-        ptr = kmalloc((unsigned long) size, GFP_KERNEL); \
-    else \
-        ptr = (cast)vmalloc((unsigned long) size); \
-    if (!ptr) \
-        printk("kernel malloc returns 0 at %s:%d\n", __FILE__, __LINE__); \
-    else memset( ptr, 0, size ); \
+#define CODA_ALLOC(ptr, cast, size)					\
+do {									\
+	if (size < PAGE_SIZE)						\
+		ptr = kzalloc((unsigned long) size, GFP_KERNEL);	\
+	else								\
+		ptr = vzalloc((unsigned long) size);			\
+	if (!ptr)							\
+		printk(KERN_ERR "kernel malloc returns 0 at %s:%d\n",	\
+		       __FILE__, __LINE__);				\
 } while (0)
 
 
-#define CODA_FREE(ptr,size) \
-    do { if (size < PAGE_SIZE) kfree((ptr)); else vfree((ptr)); } while (0)
+#define CODA_FREE(ptr, size)			\
+do {						\
+	if (size < PAGE_SIZE)			\
+		kfree((ptr));			\
+	else					\
+		vfree((ptr));			\
+} while (0)
 
 /* inode to cnode access functions */
 
-- 
1.7.3.1.g432b3.dirty

--
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