linux/include/kunit
David Gow cdc87bda60 Documentation: kunit: Warn that exit functions run even if init fails
KUnit's exit functions will run even if the corresponding init function
fails. It's easy, when writing an exit function, to assume the init
function succeeded, and (for example) access uninitialised memory or
dereference NULL pointers.

Note that this case exists and should be handled in the documentation.

Suggested-by: Benjamin Berg <benjamin@sipsolutions.net>
Link: https://lore.kernel.org/linux-kselftest/a39af0400abedb2e9b31d84c37551cecc3eed0e1.camel@sipsolutions.net/
Reviewed-by: Sadiya Kazi <sadiyakazi@google.com>
Signed-off-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2023-05-11 18:17:35 -06:00
..
assert.h kunit: remove KUNIT_INIT_MEM_ASSERTION macro 2022-12-12 14:13:47 -07:00
resource.h kunit: Use gfp in kunit_alloc_resource() kernel-doc 2023-03-17 12:28:40 -06:00
static_stub.h kunit: Expose 'static stub' API to redirect functions 2023-02-08 14:28:17 -07:00
test-bug.h kunit: Expose 'static stub' API to redirect functions 2023-02-08 14:28:17 -07:00
test.h Documentation: kunit: Warn that exit functions run even if init fails 2023-05-11 18:17:35 -06:00
try-catch.h kunit: hide unexported try-catch interface in try-catch-impl.h 2020-01-09 16:42:09 -07:00
visibility.h kunit: add macro to allow conditionally exposing static symbols to tests 2022-12-12 14:13:48 -07:00