s390/test_unwind: fix possible memleak in test_unwind()
PATCH 1/1 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 <[email protected]>
Signed-off-by Wang Hai <[email protected]>
--- arch/s390/lib/test_unwind.c | 1 + 1 file changed, 1 insertion(+)
arch/s390/lib/test_unwind.c +1 -0
@@ -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);
Signature · 1 line
2.17.1
Quoted 24 lines · Wang Hai
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 unwindingresults")
Reported-by Hulk Robot <[email protected]>Signed-off-by Wang Hai <[email protected]>--- arch/s390/lib/test_unwind.c | 1 + 1 file changed, 1 insertion(+)arch/s390/lib/test_unwind.c +1
-0@@ -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 ;
arch/s390/lib/test_unwind.c static noinline int test_unwind(struct task_struct *task, struct pt_regs *regs, · line 69
Quoted 2 lines
arch/s390/lib/test_unwind.c +0
-0}sprint_symbol (sym, addr);
Looks good to me, thanks!
Acked-by Ilya Leoshkevich <[email protected]>
Quoted 30 lines · Ilya Leoshkevich
Quoted 24 lines · Wang Hai
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 unwindingresults")
Reported-by Hulk Robot <[email protected]>Signed-off-by Wang Hai <[email protected]>--- arch/s390/lib/test_unwind.c | 1 + 1 file changed, 1 insertion(+)arch/s390/lib/test_unwind.c +1
-0@@ -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 ;arch/s390/lib/test_unwind.c static noinline int test_unwind(struct task_struct *task, struct pt_regs *regs, · line 69
Quoted 2 lines
arch/s390/lib/test_unwind.c +0
-0}sprint_symbol (sym, addr);Looks good to me, thanks!
Quoted 1 line
Acked-by Ilya Leoshkevich <[email protected]>
Applied, thanks!