objtool fix for 4.14
Linus,
please pull the latest core-urgent-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-urgent-for-linus
Plug a memory leak in the instruction decoder.
Thanks,
tglx
------------------>
Kamalesh Babulal (1):
objtool: Fix memory leak in decode_instructions()
tools/objtool/check.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
tools/objtool/check.c +7 -2
@@ -267,12 +267,13 @@ static int decode_instructions(struct objtool_file *file) &insn->immediate, &insn->stack_op);if (ret) -return ret; + goto err;if (!insn->type || insn->type >INSN_LAST ) {WARN_FUNC ("invalid instruction type %d" , insn->sec, insn->offset, insn->type); -return -1 ; + ret =-1 ; + goto err; }hash_add (file->insn_hash, &insn->hash, insn->offset);
@@ -296,6 +297,10 @@ static int decode_instructions(struct objtool_file *file) }return 0 ; + +err: +free (insn); +return ret; }/*