]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
s390/test_unwind: fix possible memleak in test_unwind()
authorWang Hai <wanghai38@huawei.com>
Thu, 30 Jul 2020 06:36:02 +0000 (14:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 11:07:41 +0000 (13:07 +0200)
[ Upstream commit 75d3e7f4769d276a056efa1cc7f08de571fc9b4b ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/s390/lib/test_unwind.c

index 32b7a30b2485d53f9dede2756ddfb7ce105bc4da..b0b12b46bc5721fc399da4378e7060a36ba5966c 100644 (file)
@@ -63,6 +63,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);