s390/test_unwind: unify error handling paths
authorVasily Gorbik <gor@linux.ibm.com>
Thu, 8 Apr 2021 22:21:14 +0000 (00:21 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 12 Apr 2021 10:46:44 +0000 (12:46 +0200)
Handle the case of "unwind state reliable but addr is 0" like other error
cases in this function and trigger output of failing stacktrace to aid
debugging.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/lib/test_unwind.c

index dcd8946255bebec680f9dc20d75f71fdf75fe4a4..54b36e71ddf304f1f36d94bc6907a96c9e3b8f0d 100644 (file)
@@ -64,8 +64,8 @@ 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;
+                       ret = -EINVAL;
+                       break;
                }
                sprint_symbol(sym, addr);
                if (bt_pos < BT_BUF_SIZE) {