From: Wang Hai Date: Thu, 30 Jul 2020 06:36:02 +0000 (+0800) Subject: s390/test_unwind: fix possible memleak in test_unwind() X-Git-Tag: v5.9-rc1~39^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=75d3e7f4769d276a056efa1cc7f08de571fc9b4b;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Wang Hai Acked-by: Ilya Leoshkevich Signed-off-by: Heiko Carstens --- diff --git a/arch/s390/lib/test_unwind.c b/arch/s390/lib/test_unwind.c index eb382ceaa1161..7c988994931f0 100644 --- a/arch/s390/lib/test_unwind.c +++ b/arch/s390/lib/test_unwind.c @@ -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);