initramfs: free initrd memory if opening /initrd.image fails
Patch series "initramfs tidyups".
I've spent some time chasing down behavior in initramfs and found
plenty of opportunity to improve the code. A first stab on that is
contained in this series.
This patch (of 7):
We free the initrd memory for all successful or error cases except for the
case where opening /initrd.image fails, which looks like an oversight.
: This also changes the behaviour when CONFIG_INITRAMFS_FORCE is enabled
: - specifically it means that the initrd is freed (previously it was
: ignored and never freed). But that seems like reasonable behaviour and
: the previous behaviour looks like another oversight.
Signed-off-by: Christoph Hellwig <email@example.com>
Reviewed-by: Steven Price <firstname.lastname@example.org>
Acked-by: Mike Rapoport <email@example.com>
Cc: Catalin Marinas <firstname.lastname@example.org> [arm64]
Cc: Geert Uytterhoeven <email@example.com> [m68k]
Cc: Alexander Viro <firstname.lastname@example.org>
Cc: Russell King <email@example.com>
Cc: Will Deacon <firstname.lastname@example.org>
Cc: Guan Xuetao <email@example.com>
Signed-off-by: Andrew Morton <firstname.lastname@example.org>
Signed-off-by: Linus Torvalds <email@example.com>
1 file changed