From ef9f313fd632d7eade116a3161ef313a1421c4d7 Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Thu, 11 Jul 2024 16:41:45 +0200 Subject: [PATCH] initramfs: break loop when decompression finishes This fixes booting with initramfs (cpio.gz based) with additional garbage added after the main initramfs image. Signed-off-by: Marek Szyprowski Change-Id: I329aa0e14a6f5079bc0b5a1f4fb79f11365e0755 --- init/initramfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/init/initramfs.c b/init/initramfs.c index bf3af10c500a..ba0c6a917278 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -488,6 +488,7 @@ static char * __init unpack_to_rootfs(char *buf, unsigned long len) &my_inptr, error); if (res) error("decompressor failed"); + break; } else if (compress_name) { if (!message) { snprintf(msg_buf, sizeof msg_buf, -- 2.34.1