Whamcloud - gitweb
LU-18141 misc: (for [mf]*) don't check NULL before free'ing 48/56048/2
authorTimothy Day <timday@amazon.com>
Wed, 14 Aug 2024 05:07:59 +0000 (01:07 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 23 Aug 2024 22:08:39 +0000 (22:08 +0000)
commite0aeb99bbf8806fabd29e14de0131266ad440320
tree47005e4589d42943d81f7a5294162274eb78b32d
parent4effc77c193dd15b9c440227838fbf3271456a72
LU-18141 misc: (for [mf]*) 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: I027db689261e507a3f297a31643baf2ed61bcc7c
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56048
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: jsimmons <jsimmons@infradead.org>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/fid/lproc_fid.c
lustre/fld/fld_index.c
lustre/fld/lproc_fld.c
lustre/mdc/mdc_changelog.c
lustre/mdd/mdd_device.c
lustre/mdd/mdd_orphans.c
lustre/mgs/mgs_llog.c