diff options
author | Panagiotis Issaris <takis@issaris.org> | 2006-09-27 04:49:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-27 11:26:10 -0400 |
commit | f8314dc60ccba7e41f425048c4160dc7f63377d5 (patch) | |
tree | 4e361a6e93dc7f64da0244e5a0dfef1fface0ddb /fs/proc | |
parent | 32c2d2bc4bed61323f14f2a7d69ccbd567253d8a (diff) |
[PATCH] fs: Conversions from kmalloc+memset to k(z|c)alloc
Conversions from kmalloc+memset to kzalloc.
Signed-off-by: Panagiotis Issaris <takis@issaris.org>
Jffs2-bit-acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/kcore.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 6a984f64edd7..3ceff3857272 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c | |||
@@ -279,12 +279,11 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) | |||
279 | tsz = elf_buflen - *fpos; | 279 | tsz = elf_buflen - *fpos; |
280 | if (buflen < tsz) | 280 | if (buflen < tsz) |
281 | tsz = buflen; | 281 | tsz = buflen; |
282 | elf_buf = kmalloc(elf_buflen, GFP_ATOMIC); | 282 | elf_buf = kzalloc(elf_buflen, GFP_ATOMIC); |
283 | if (!elf_buf) { | 283 | if (!elf_buf) { |
284 | read_unlock(&kclist_lock); | 284 | read_unlock(&kclist_lock); |
285 | return -ENOMEM; | 285 | return -ENOMEM; |
286 | } | 286 | } |
287 | memset(elf_buf, 0, elf_buflen); | ||
288 | elf_kcore_store_hdr(elf_buf, nphdr, elf_buflen); | 287 | elf_kcore_store_hdr(elf_buf, nphdr, elf_buflen); |
289 | read_unlock(&kclist_lock); | 288 | read_unlock(&kclist_lock); |
290 | if (copy_to_user(buffer, elf_buf + *fpos, tsz)) { | 289 | if (copy_to_user(buffer, elf_buf + *fpos, tsz)) { |
@@ -330,10 +329,9 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) | |||
330 | unsigned long curstart = start; | 329 | unsigned long curstart = start; |
331 | unsigned long cursize = tsz; | 330 | unsigned long cursize = tsz; |
332 | 331 | ||
333 | elf_buf = kmalloc(tsz, GFP_KERNEL); | 332 | elf_buf = kzalloc(tsz, GFP_KERNEL); |
334 | if (!elf_buf) | 333 | if (!elf_buf) |
335 | return -ENOMEM; | 334 | return -ENOMEM; |
336 | memset(elf_buf, 0, tsz); | ||
337 | 335 | ||
338 | read_lock(&vmlist_lock); | 336 | read_lock(&vmlist_lock); |
339 | for (m=vmlist; m && cursize; m=m->next) { | 337 | for (m=vmlist; m && cursize; m=m->next) { |