diff options
Diffstat (limited to 'init/initramfs.c')
-rw-r--r-- | init/initramfs.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/init/initramfs.c b/init/initramfs.c index d53fee8d8604..8eeeccb328c9 100644 --- a/init/initramfs.c +++ b/init/initramfs.c | |||
@@ -57,7 +57,7 @@ static char __init *find_link(int major, int minor, int ino, | |||
57 | continue; | 57 | continue; |
58 | return (*p)->name; | 58 | return (*p)->name; |
59 | } | 59 | } |
60 | q = (struct hash *)malloc(sizeof(struct hash)); | 60 | q = kmalloc(sizeof(struct hash), GFP_KERNEL); |
61 | if (!q) | 61 | if (!q) |
62 | panic("can't allocate link hash entry"); | 62 | panic("can't allocate link hash entry"); |
63 | q->major = major; | 63 | q->major = major; |
@@ -77,7 +77,7 @@ static void __init free_hash(void) | |||
77 | while (*p) { | 77 | while (*p) { |
78 | q = *p; | 78 | q = *p; |
79 | *p = q->next; | 79 | *p = q->next; |
80 | free(q); | 80 | kfree(q); |
81 | } | 81 | } |
82 | } | 82 | } |
83 | } | 83 | } |
@@ -445,10 +445,10 @@ static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only) | |||
445 | { | 445 | { |
446 | int written; | 446 | int written; |
447 | dry_run = check_only; | 447 | dry_run = check_only; |
448 | header_buf = malloc(110); | 448 | header_buf = kmalloc(110, GFP_KERNEL); |
449 | symlink_buf = malloc(PATH_MAX + N_ALIGN(PATH_MAX) + 1); | 449 | symlink_buf = kmalloc(PATH_MAX + N_ALIGN(PATH_MAX) + 1, GFP_KERNEL); |
450 | name_buf = malloc(N_ALIGN(PATH_MAX)); | 450 | name_buf = kmalloc(N_ALIGN(PATH_MAX), GFP_KERNEL); |
451 | window = malloc(WSIZE); | 451 | window = kmalloc(WSIZE, GFP_KERNEL); |
452 | if (!window || !header_buf || !symlink_buf || !name_buf) | 452 | if (!window || !header_buf || !symlink_buf || !name_buf) |
453 | panic("can't allocate buffers"); | 453 | panic("can't allocate buffers"); |
454 | state = Start; | 454 | state = Start; |
@@ -484,10 +484,10 @@ static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only) | |||
484 | buf += inptr; | 484 | buf += inptr; |
485 | len -= inptr; | 485 | len -= inptr; |
486 | } | 486 | } |
487 | free(window); | 487 | kfree(window); |
488 | free(name_buf); | 488 | kfree(name_buf); |
489 | free(symlink_buf); | 489 | kfree(symlink_buf); |
490 | free(header_buf); | 490 | kfree(header_buf); |
491 | return message; | 491 | return message; |
492 | } | 492 | } |
493 | 493 | ||