diff options
author | Nick Bray <ncbray@google.com> | 2017-11-30 15:49:54 -0800 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2017-12-18 11:32:25 -0800 |
commit | cc43e740474ae7c5ea9ab286eb4c4323411dbc07 (patch) | |
tree | a831a8364448f198c2ab7a1379f23c0b15cf3c07 /init | |
parent | 9e759250de8d7a83d20d1bc3a547e195746bbe94 (diff) |
ANDROID: initramfs: call free_initrd() when skipping init
Memory allocated for initrd would not be reclaimed if initializing ramfs
was skipped.
Bug: 69901741
Test: "grep MemTotal /proc/meminfo" increases by a few MB on an Android
device with a/b boot.
Change-Id: Ifbe094d303ed12cfd6de6aa004a8a19137a2f58a
Signed-off-by: Nick Bray <ncbray@google.com>
Diffstat (limited to 'init')
-rw-r--r-- | init/initramfs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/init/initramfs.c b/init/initramfs.c index a8072c9cca93..5ea7f1b5ec44 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -623,8 +623,11 @@ static int __init populate_rootfs(void) { char *err; - if (do_skip_initramfs) + if (do_skip_initramfs) { + if (initrd_start) + free_initrd(); return default_rootfs(); + } /* Load the built in initramfs */ err = unpack_to_rootfs(__initramfs_start, __initramfs_size); |