Skip to content
Commit d00dd2f2 authored by Takashi Iwai's avatar Takashi Iwai Committed by Borislav Petkov (AMD)
Browse files

x86/kexec: Fix double-free of elf header buffer



After

  b3e34a47 ("x86/kexec: fix memory leak of elf header buffer"),

freeing image->elf_headers in the error path of crash_load_segments()
is not needed because kimage_file_post_load_cleanup() will take
care of that later. And not clearing it could result in a double-free.

Drop the superfluous vfree() call at the error path of
crash_load_segments().

Fixes: b3e34a47 ("x86/kexec: fix memory leak of elf header buffer")
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
Acked-by: default avatarBaoquan He <bhe@redhat.com>
Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
Cc: <stable@kernel.org>
Link: https://lore.kernel.org/r/20221122115122.13937-1-tiwai@suse.de
parent 88603b6d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment