For cfs_expr_list_values() allocator use cfs_expr_list_values_free()
as deallocator.
Coverity actually complained that kfree() should not
be called but free() should be called instead. It looks
like coverity is checking under file libcfs/libcfs/util/string.c
function cfs_expr_list_values which is calling calloc().
This cannot be correct under ptlrpc
Test-Parameters: trivial
CoverityID: 424700 ("Incorrect deallocator used")
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: Idfbb6be585b35f87a59ae92d0cffa85c8dff623a
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55043
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
if (rc <= 0) {
CERROR("%s: failed to parse CPT array %s: %d\n",
conf->psc_name, cconf->cc_pattern, rc);
- if (cpts != NULL)
- OBD_FREE_PTR_ARRAY(cpts, ncpts);
RETURN(ERR_PTR(rc < 0 ? rc : -EINVAL));
}
ncpts = rc;
OBD_ALLOC(service, offsetof(struct ptlrpc_service, srv_parts[ncpts]));
if (service == NULL) {
if (cpts != NULL)
- OBD_FREE_PTR_ARRAY(cpts, ncpts);
+ cfs_expr_list_values_free(cpts, ncpts);
RETURN(ERR_PTR(-ENOMEM));
}