X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=init%2Fdo_mounts_rd.c;h=7c098ac9068a582af317596908390ad74011040e;hb=ea1e7ed33708c7a760419ff9ded0a6cb90586a50;hp=6be2879cca66971859b1c51ff80451616ab13975;hpb=f9ba7179ce91fb77b2adf6eaab3676ab3a1f5a15;p=cascardo%2Flinux.git diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c index 6be2879cca66..7c098ac9068a 100644 --- a/init/do_mounts_rd.c +++ b/init/do_mounts_rd.c @@ -57,6 +57,11 @@ static int __init crd_load(int in_fd, int out_fd, decompress_fn deco); * cramfs * squashfs * gzip + * bzip2 + * lzma + * xz + * lzo + * lz4 */ static int __init identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor) @@ -342,6 +347,13 @@ static int __init crd_load(int in_fd, int out_fd, decompress_fn deco) int result; crd_infd = in_fd; crd_outfd = out_fd; + + if (!deco) { + pr_emerg("Invalid ramdisk decompression routine. " + "Select appropriate config option.\n"); + panic("Could not decompress initial ramdisk image."); + } + result = deco(NULL, 0, compr_fill, compr_flush, NULL, NULL, error); if (decompress_error) result = 1;