mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-20 22:15:59 +00:00
scftorture: Avoid NULL pointer exception on early exit
When scftorture finds an error in the module parameters controlling the relative frequencies of smp_call_function*() variants, it takes an early exit. So early that it has not allocated memory to track the kthreads running the test, which results in a segfault. This commit therefore checks for the existence of the memory before attempting to stop the kthreads that would otherwise have been recorded in that non-existent memory. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
parent
9b9a80677f
commit
586e4d4193
1 changed files with 1 additions and 1 deletions
|
@ -513,7 +513,7 @@ static void scf_torture_cleanup(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
WRITE_ONCE(scfdone, true);
|
WRITE_ONCE(scfdone, true);
|
||||||
if (nthreads)
|
if (nthreads && scf_stats_p)
|
||||||
for (i = 0; i < nthreads; i++)
|
for (i = 0; i < nthreads; i++)
|
||||||
torture_stop_kthread("scftorture_invoker", scf_stats_p[i].task);
|
torture_stop_kthread("scftorture_invoker", scf_stats_p[i].task);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue