kernel_atomic_dec_test_path: move this into a separate module
commita7d333907e00196d52abec98edc9e23f181006d8
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 28 Jul 2023 18:04:20 +0000 (28 21:04 +0300)
committerDan Carpenter <dan.carpenter@linaro.org>
Fri, 28 Jul 2023 18:07:48 +0000 (28 21:07 +0300)
tree605885af0cf794ae19a562e79231cf15a257b67a
parent2d8f596e726c37b4c07d96e777f7d850f8152f05
kernel_atomic_dec_test_path: move this into a separate module

This code is to detect places like:

if (!refcount_dec_and_test(&fclones->fclone_ref))
return;

Which is normally used in free() functions where we just drop a reference
until there are zero references left and then we free everything.

Move it into a separate module so it's cleaner.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Makefile
check_atomic_inc_dec.c
check_list.h
smatch_kernel_atomic_dec_test_path.c [new file with mode: 0644]