History

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.

Paul E. McKenney committed 5 years ago

Commit 586e4d41 parent 9b9a8061 file · +1 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/scftorture.c+1−1
@@ -513,7 +513,7 @@ static void scf_torture_cleanup(void) · 512 unmodified lines
513513 return;
514514
515515 WRITE_ONCE(scfdone, true);
516− if (nthreads)
516+ if (nthreads && scf_stats_p)
517517 for (i = 0; i < nthreads; i++)
518518 torture_stop_kthread("scftorture_invoker", scf_stats_p[i].task);
519519 else

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t