]> git.baikalelectronics.ru Git - kernel.git/commitdiff
initramfs: avoid "label at end of compound statement" error
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 May 2017 17:27:13 +0000 (10:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 May 2017 17:27:13 +0000 (10:27 -0700)
Commit 89bbe7835960 ("initramfs: Always do fput() and load modules after
rootfs populate") introduced an error for the

    CONFIG_BLK_DEV_RAM=y

case, because even though the code looks fine, the compiler really wants
a statement after a label, or you'll get complaints:

  init/initramfs.c: In function 'populate_rootfs':
  init/initramfs.c:644:2: error: label at end of compound statement

That commit moved the subsequent statements to outside the compound
statement, leaving the label without any associated statements.

Reported-by: Jörg Otte <jrg.otte@gmail.com>
Fixes: 89bbe7835960 ("initramfs: Always do fput() and load modules after rootfs populate")
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Stafford Horne <shorne@gmail.com>
Cc: stable@vger.kernel.org # if 89bbe7835960 gets backported
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
init/initramfs.c

index 3a68715973514378792bd291cf391c70daecaa21..8daf7ac6c7e2ca77ebc9f97c6bcabc33f186cd5b 100644 (file)
@@ -642,6 +642,7 @@ static int __init populate_rootfs(void)
                        free_initrd();
                }
        done:
+               /* empty statement */;
 #else
                printk(KERN_INFO "Unpacking initramfs...\n");
                err = unpack_to_rootfs((char *)initrd_start,