1
0
Fork 0

s390/test_unwind: fix possible memleak in test_unwind()

test_unwind() misses to call kfree(bt) in an error path.
Add the missed function call to fix it.

Fixes: 0610154650 ("s390/test_unwind: print verbose unwinding results")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
zero-sugar-mainline-defconfig
Wang Hai 2020-07-30 14:36:02 +08:00 committed by Heiko Carstens
parent ba925fa350
commit 75d3e7f476
1 changed files with 1 additions and 0 deletions

View File

@ -64,6 +64,7 @@ static noinline int test_unwind(struct task_struct *task, struct pt_regs *regs,
break;
if (state.reliable && !addr) {
pr_err("unwind state reliable but addr is 0\n");
kfree(bt);
return -EINVAL;
}
sprint_symbol(sym, addr);