All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [Patch] kzalloc conversion in fs/proc
@ 2006-02-21 23:01 Eric Sesterhenn
  2006-02-21 23:13 ` Jesper Juhl
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Eric Sesterhenn @ 2006-02-21 23:01 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1576 bytes --]

hi,

this converts fs/proc to kzalloc() usage.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.16-rc4/fs/proc/kcore.c.orig	2006-02-21 23:58:12.000000000 +0100
+++ linux-2.6.16-rc4/fs/proc/kcore.c	2006-02-21 23:58:48.000000000 +0100
@@ -282,12 +282,11 @@ read_kcore(struct file *file, char __use
 		tsz = elf_buflen - *fpos;
 		if (buflen < tsz)
 			tsz = buflen;
-		elf_buf = kmalloc(elf_buflen, GFP_ATOMIC);
+		elf_buf = kzalloc(elf_buflen, GFP_ATOMIC);
 		if (!elf_buf) {
 			read_unlock(&kclist_lock);
 			return -ENOMEM;
 		}
-		memset(elf_buf, 0, elf_buflen);
 		elf_kcore_store_hdr(elf_buf, nphdr, elf_buflen);
 		read_unlock(&kclist_lock);
 		if (copy_to_user(buffer, elf_buf + *fpos, tsz)) {
@@ -333,10 +332,9 @@ read_kcore(struct file *file, char __use
 			unsigned long curstart = start;
 			unsigned long cursize = tsz;
 
-			elf_buf = kmalloc(tsz, GFP_KERNEL);
+			elf_buf = kzalloc(tsz, GFP_KERNEL);
 			if (!elf_buf)
 				return -ENOMEM;
-			memset(elf_buf, 0, tsz);
 
 			read_lock(&vmlist_lock);
 			for (m=vmlist; m && cursize; m=m->next) {
--- linux-2.6.16-rc4/fs/proc/vmcore.c.orig	2006-02-21 23:54:00.000000000 +0100
+++ linux-2.6.16-rc4/fs/proc/vmcore.c	2006-02-21 23:54:59.000000000 +0100
@@ -179,12 +179,7 @@ struct file_operations proc_vmcore_opera
 
 static struct vmcore* __init get_new_element(void)
 {
-	struct vmcore *p;
-
-	p = kmalloc(sizeof(*p), GFP_KERNEL);
-	if (p)
-		memset(p, 0, sizeof(*p));
-	return p;
+	return = kzalloc(sizeof(struct vmcore), GFP_KERNEL);
 }
 
 static u64 __init get_vmcore_size_elf64(char *elfptr)



[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2006-02-22 23:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-21 23:01 [KJ] [Patch] kzalloc conversion in fs/proc Eric Sesterhenn
2006-02-21 23:13 ` Jesper Juhl
2006-02-22  0:01 ` Eric Sesterhenn
2006-02-22  0:14 ` Jesper Juhl
2006-02-22  0:14 ` Randy.Dunlap
2006-02-22 19:14 ` Alexey Dobriyan
2006-02-22 19:29 ` Eric Sesterhenn
2006-02-22 19:29 ` Nishanth Aravamudan
2006-02-22 19:51 ` Jaco Kroon
2006-02-22 20:24 ` Nishanth Aravamudan
2006-02-22 21:01 ` Alexey Dobriyan
2006-02-22 23:55 ` Jesper Juhl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.