Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kunit: Fix wrong parameter to kunit_deactivate_static_stub()

kunit_deactivate_static_stub() accepts real_fn_addr instead of
replacement_addr. In the case, it always passes NULL to
kunit_deactivate_static_stub().

Fix it.

Link: https://lore.kernel.org/r/20250520082050.2254875-1-tzungbi@kernel.org
Fixes: e047c5eaa763 ("kunit: Expose 'static stub' API to redirect functions")
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Tzung-Bi Shih and committed by
Shuah Khan
772e50a7 ce7ff266

+1 -1
+1 -1
lib/kunit/static_stub.c
··· 96 96 97 97 /* If the replacement address is NULL, deactivate the stub. */ 98 98 if (!replacement_addr) { 99 - kunit_deactivate_static_stub(test, replacement_addr); 99 + kunit_deactivate_static_stub(test, real_fn_addr); 100 100 return; 101 101 } 102 102