mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-15 19:26:51 +07:00
49ee4dd2e7
Add proper error handling when allocating or getting shadow variables in the selftest. It prevents an invalid pointer access in some situations. It shows the good programming practice in the others. The error codes are just the best guess and specific for this particular test. In general, klp_shadow_alloc() returns NULL also when the given shadow variable has already been allocated. In addition, both klp_shadow_alloc() and klp_shadow_get_or_alloc() might fail from other reasons when the constructor fails. Note, that the error code is not really important even in the real life. The use of shadow variables should be transparent for the original livepatched code. Acked-by: Miroslav Benes <mbenes@suse.cz> Acked-by: Joe Lawrence <joe.lawrence@redhat.com> Signed-off-by: Petr Mladek <pmladek@suse.com> |
||
---|---|---|
.. | ||
Makefile | ||
test_klp_atomic_replace.c | ||
test_klp_callbacks_busy.c | ||
test_klp_callbacks_demo2.c | ||
test_klp_callbacks_demo.c | ||
test_klp_callbacks_mod.c | ||
test_klp_livepatch.c | ||
test_klp_shadow_vars.c |