|
20 | 20 | #include <linux/security.h>
|
21 | 21 |
|
22 | 22 | #include "do_mounts.h"
|
| 23 | +#include "initramfs_internal.h" |
23 | 24 |
|
24 | 25 | static __initdata bool csum_present;
|
25 | 26 | static __initdata u32 io_csum;
|
@@ -256,7 +257,7 @@ static __initdata char *header_buf, *symlink_buf, *name_buf;
|
256 | 257 |
|
257 | 258 | static int __init do_start(void)
|
258 | 259 | {
|
259 |
| - read_into(header_buf, 110, GotHeader); |
| 260 | + read_into(header_buf, CPIO_HDRLEN, GotHeader); |
260 | 261 | return 0;
|
261 | 262 | }
|
262 | 263 |
|
@@ -497,14 +498,23 @@ static unsigned long my_inptr __initdata; /* index of next byte to be processed
|
497 | 498 |
|
498 | 499 | #include <linux/decompress/generic.h>
|
499 | 500 |
|
500 |
| -static char * __init unpack_to_rootfs(char *buf, unsigned long len) |
| 501 | +/** |
| 502 | + * unpack_to_rootfs - decompress and extract an initramfs archive |
| 503 | + * @buf: input initramfs archive to extract |
| 504 | + * @len: length of initramfs data to process |
| 505 | + * |
| 506 | + * Returns: NULL for success or an error message string |
| 507 | + * |
| 508 | + * This symbol shouldn't be used externally. It's available for unit tests. |
| 509 | + */ |
| 510 | +char * __init unpack_to_rootfs(char *buf, unsigned long len) |
501 | 511 | {
|
502 | 512 | long written;
|
503 | 513 | decompress_fn decompress;
|
504 | 514 | const char *compress_name;
|
505 | 515 | static __initdata char msg_buf[64];
|
506 | 516 |
|
507 |
| - header_buf = kmalloc(110, GFP_KERNEL); |
| 517 | + header_buf = kmalloc(CPIO_HDRLEN, GFP_KERNEL); |
508 | 518 | symlink_buf = kmalloc(PATH_MAX + N_ALIGN(PATH_MAX) + 1, GFP_KERNEL);
|
509 | 519 | name_buf = kmalloc(N_ALIGN(PATH_MAX), GFP_KERNEL);
|
510 | 520 |
|
|
0 commit comments