Masahiro Yamada a06d07dd52 scripts/kallsyms: fix definitely-lost memory leak
[ Upstream commit 21915eca088dc271c970e8351290e83d938114ac ]

build_initial_tok_table() overwrites unused sym_entry to shrink the
table size. Before the entry is overwritten, table[i].sym must be freed
since it is malloc'ed data.

This fixes the 'definitely lost' report from valgrind. I ran valgrind
against x86_64_defconfig of v5.4-rc8 kernel, and here is the summary:

[Before the fix]

  LEAK SUMMARY:
     definitely lost: 53,184 bytes in 2,874 blocks

[After the fix]

  LEAK SUMMARY:
     definitely lost: 0 bytes in 0 blocks

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-04 13:59:51 +01:00
..
2017-03-28 16:16:52 +02:00
2011-08-31 16:12:17 +02:00
2012-06-27 12:44:29 -07:00
2018-02-16 20:23:04 +01:00
2014-08-20 16:03:45 +02:00