Whamcloud - gitweb
LU-18141 misc: (for l*) don't check NULL before free'ing 49/56049/3
authorTimothy Day <timday@amazon.com>
Wed, 14 Aug 2024 05:10:23 +0000 (01:10 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 23 Aug 2024 22:08:49 +0000 (22:08 +0000)
commit702cffaa1bd2fb2d430f2af7994834b4225ea6fe
treedf2f43baec0594b8974f44c26bb3ac8639a2bda0
parente0aeb99bbf8806fabd29e14de0131266ad440320
LU-18141 misc: (for l*) don't check NULL before free'ing

The common free'ing macros already check for NULL,
so we don't need to explicitly check this beforehand.

The patch has been generated with the coccinelle script below.

@@
expression E;
@@
- if (E != NULL)
(
  OBD_FREE_PTR(E);
|
  OBD_FREE(E, ...);
|
  LIBCFS_FREE(E, ...);
|
  CFS_FREE_PTR(E);
|
  CFS_FREE_PTR_ARRAY(E, ...);
)

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I9619a08ff736e727544a0442f588e2a0a9f6ad22
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56049
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: jsimmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
13 files changed:
libcfs/libcfs/hash.c
lnet/klnds/gnilnd/gnilnd_proc.c
lnet/klnds/o2iblnd/o2iblnd.c
lnet/klnds/socklnd/socklnd.c
lnet/selftest/conctl.c
lnet/selftest/console.c
lustre/ldlm/ldlm_lib.c
lustre/ldlm/ldlm_resource.c
lustre/lfsck/lfsck_layout.c
lustre/lmv/lmv_obd.c
lustre/lod/lod_dev.c
lustre/lod/lod_object.c
lustre/lov/lov_request.c