sysctl: Close test ctl_headers with a for loop
authorJoel Granados <joel.granados@kernel.org>
Tue, 18 Mar 2025 21:30:09 +0000 (22:30 +0100)
committerJoel Granados <joel.granados@kernel.org>
Mon, 14 Apr 2025 12:13:41 +0000 (14:13 +0200)
commit23b8bacf154759ed922d25527dda434fbf57436a
treeca73f91237fe2fb156fba42e443cb29ca057a97c
parent2bac112eaaf391f190905134cc8e7ffc02dd131c
sysctl: Close test ctl_headers with a for loop

As more tests are added, the exit function gets longer than it should
be. Condense the un-register calls into a for loop to make it easier to
add/remove tests.

Reviewed-by: Kees Cook <kees@kernel.org>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
lib/test_sysctl.c