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
Test-Parameters: trivial fstype=zfs
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I62d78961192f00faf83f9f3fee3c4bf5b8006863
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56044
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
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>
cleanup:
mutex_unlock(&map->om_dir_init_mutex);
if (rc != 0) {
- if (osd_seq != NULL)
- OBD_FREE_PTR(osd_seq);
+ OBD_FREE_PTR(osd_seq);
RETURN(ERR_PTR(rc));
}
info->oti_ins_cache = NULL;
info->oti_ins_cache_size = 0;
}
- if (info->oti_lookup_cache)
- OBD_FREE_PTR(info->oti_lookup_cache);
+ OBD_FREE_PTR(info->oti_lookup_cache);
OBD_FREE_PTR(info);
}
if (osd_seq != NULL && osd_seq->os_compat_dirs != NULL)
OBD_FREE_PTR_ARRAY(osd_seq->os_compat_dirs,
osd_seq->os_subdir_count);
- if (osd_seq != NULL)
- OBD_FREE_PTR(osd_seq);
+ OBD_FREE_PTR(osd_seq);
osd_seq = ERR_PTR(rc);
}
RETURN(osd_seq);