Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 0610154650f1 ("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>

authored by

Wang Hai and committed by
Heiko Carstens
75d3e7f4 ba925fa3

+1
+1
arch/s390/lib/test_unwind.c
··· 64 64 break; 65 65 if (state.reliable && !addr) { 66 66 pr_err("unwind state reliable but addr is 0\n"); 67 + kfree(bt); 67 68 return -EINVAL; 68 69 } 69 70 sprint_symbol(sym, addr);