ndctl-79-2.fc41

List of Defects

Error: CLANG_WARNING: [#def1]
ndctl-79-build/ndctl-79/ndctl/lib/inject.c:7: included_from: Included from here.
ndctl-79-build/ndctl-79/ccan/list/list.h:327:16: warning[core.NullDereference]: Access to field 'prev' results in a dereference of a null pointer (loaded from field 'next')
#  325|   {
#  326|   	(void)list_debug_node(n, abortstr);
#  327|-> 	n->next->prev = n->prev;
#  328|   	n->prev->next = n->next;
#  329|   #ifdef CCAN_LIST_DEBUG

Error: CLANG_WARNING: [#def2]
ndctl-79-build/ndctl-79/cxl/bus.c:118:2: warning[deadcode.DeadStores]: Value stored to 'rc' is never read
#  116|   		bl.log_priority = LOG_INFO;
#  117|   
#  118|-> 	rc = 0;
#  119|   	err = 0;
#  120|   	count = 0;

Error: CLANG_WARNING: [#def3]
ndctl-79-build/ndctl-79/cxl/cxl.c:48:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#   46|   	};
#   47|   
#   48|-> 	argc = parse_options_subcommand(argc, argv, builtin_help_options,
#   49|   			builtin_help_subcommands, builtin_help_usage, 0);
#   50|   

Error: CPPCHECK_WARNING: [#def4]
ndctl-79-build/ndctl-79/cxl/filter.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def5]
ndctl-79-build/ndctl-79/cxl/json.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-415): [#def6]
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_unref.part.0’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3313:17: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*cmd.query_cmd’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:26: included_from: Included from here.
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3336:16: note: in expansion of macro ‘struct_size’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3336:16: note: in expansion of macro ‘struct_size’
ndctl-79-build/ndctl-79/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-79-build/ndctl-79/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_unref.part.0’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:15: included_from: Included from here.
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_unref.part.0’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3336:16: note: in expansion of macro ‘struct_size’
ndctl-79-build/ndctl-79/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:24: included_from: Included from here.
ndctl-79-build/ndctl-79/util/log.h:46:32: note: in expansion of macro ‘log_cond’
ndctl-79-build/ndctl-79/util/log.h:57:24: note: in expansion of macro ‘log_err’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3603:17: note: in expansion of macro ‘err’
# 3311|   		return;
# 3312|   	if (--cmd->refcount == 0) {
# 3313|-> 		free(cmd->query_cmd);
# 3314|   		free(cmd->send_cmd);
# 3315|   		free(cmd->input_payload);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3314:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3336:16: note: in expansion of macro ‘struct_size’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3336:16: note: in expansion of macro ‘struct_size’
ndctl-79-build/ndctl-79/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-79-build/ndctl-79/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_unref.part.0’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_unref.part.0’
ndctl-79-build/ndctl-79/util/log.h:41:34: note: in expansion of macro ‘log_cond’
ndctl-79-build/ndctl-79/util/log.h:55:24: note: in expansion of macro ‘log_dbg’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3467:9: note: in expansion of macro ‘dbg’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3336:16: note: in expansion of macro ‘struct_size’
ndctl-79-build/ndctl-79/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-79-build/ndctl-79/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_unref.part.0’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_unref.part.0’
ndctl-79-build/ndctl-79/util/log.h:41:34: note: in expansion of macro ‘log_cond’
ndctl-79-build/ndctl-79/util/log.h:55:24: note: in expansion of macro ‘log_dbg’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3487:17: note: in expansion of macro ‘dbg’
ndctl-79-build/ndctl-79/util/log.h:46:32: note: in expansion of macro ‘log_cond’
ndctl-79-build/ndctl-79/util/log.h:57:24: note: in expansion of macro ‘log_err’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:4467:17: note: in expansion of macro ‘err’
ndctl-79-build/ndctl-79/util/log.h:46:32: note: in expansion of macro ‘log_cond’
ndctl-79-build/ndctl-79/util/log.h:57:24: note: in expansion of macro ‘log_err’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:4467:17: note: in expansion of macro ‘err’
# 3312|   	if (--cmd->refcount == 0) {
# 3313|   		free(cmd->query_cmd);
# 3314|-> 		free(cmd->send_cmd);
# 3315|   		free(cmd->input_payload);
# 3316|   		free(cmd->output_payload);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_set_input_payload’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3513:43: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3336:16: note: in expansion of macro ‘struct_size’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3336:16: note: in expansion of macro ‘struct_size’
ndctl-79-build/ndctl-79/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-79-build/ndctl-79/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_set_input_payload’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_set_input_payload’
ndctl-79-build/ndctl-79/util/log.h:41:34: note: in expansion of macro ‘log_cond’
ndctl-79-build/ndctl-79/util/log.h:55:24: note: in expansion of macro ‘log_dbg’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3467:9: note: in expansion of macro ‘dbg’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3336:16: note: in expansion of macro ‘struct_size’
ndctl-79-build/ndctl-79/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-79-build/ndctl-79/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_set_input_payload’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_set_input_payload’
ndctl-79-build/ndctl-79/util/log.h:41:34: note: in expansion of macro ‘log_cond’
ndctl-79-build/ndctl-79/util/log.h:55:24: note: in expansion of macro ‘log_dbg’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3487:17: note: in expansion of macro ‘dbg’
# 3511|   		if (!cmd->input_payload)
# 3512|   			return -ENOMEM;
# 3513|-> 		cmd->send_cmd->in.payload = (u64)cmd->input_payload;
# 3514|   	} else {
# 3515|   		/*

Error: GCC_ANALYZER_WARNING (CWE-476): [#def9]
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_read_label’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:4209:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘get_lsa’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3336:16: note: in expansion of macro ‘struct_size’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3336:16: note: in expansion of macro ‘struct_size’
ndctl-79-build/ndctl-79/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-79-build/ndctl-79/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_read_label’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_read_label’
ndctl-79-build/ndctl-79/util/log.h:41:34: note: in expansion of macro ‘log_cond’
ndctl-79-build/ndctl-79/util/log.h:55:24: note: in expansion of macro ‘log_dbg’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3467:9: note: in expansion of macro ‘dbg’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3336:16: note: in expansion of macro ‘struct_size’
ndctl-79-build/ndctl-79/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-79-build/ndctl-79/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_read_label’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_read_label’
ndctl-79-build/ndctl-79/util/log.h:41:34: note: in expansion of macro ‘log_cond’
ndctl-79-build/ndctl-79/util/log.h:55:24: note: in expansion of macro ‘log_dbg’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3487:17: note: in expansion of macro ‘dbg’
# 4207|   
# 4208|   	get_lsa = (struct cxl_cmd_get_lsa_in *)cmd->send_cmd->in.payload;
# 4209|-> 	get_lsa->offset = cpu_to_le32(offset);
# 4210|   	get_lsa->length = cpu_to_le32(length);
# 4211|   	return cmd;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def10]
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_set_partition’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:4315:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 4313|   			CXL_MEM_COMMAND_ID_SET_PARTITION_INFO);
# 4314|   
# 4315|-> 	setpart = cmd->input_payload;
# 4316|   	setpart->volatile_size = cpu_to_le64(volatile_size)
# 4317|   					/ CXL_CAPACITY_MULTIPLIER;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def11]
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:4316:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘setpart’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3336:16: note: in expansion of macro ‘struct_size’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3336:16: note: in expansion of macro ‘struct_size’
ndctl-79-build/ndctl-79/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-79-build/ndctl-79/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_set_partition’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_set_partition’
ndctl-79-build/ndctl-79/util/log.h:41:34: note: in expansion of macro ‘log_cond’
ndctl-79-build/ndctl-79/util/log.h:55:24: note: in expansion of macro ‘log_dbg’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3467:9: note: in expansion of macro ‘dbg’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3336:16: note: in expansion of macro ‘struct_size’
ndctl-79-build/ndctl-79/util/size.h:216:25: note: in expansion of macro ‘__unsigned_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:228:13: note: in expansion of macro ‘check_mul_overflow’
ndctl-79-build/ndctl-79/util/size.h:206:25: note: in expansion of macro ‘__unsigned_add_overflow’
ndctl-79-build/ndctl-79/util/size.h:230:13: note: in expansion of macro ‘check_add_overflow’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_set_partition’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c: scope_hint: In function ‘cxl_cmd_new_set_partition’
ndctl-79-build/ndctl-79/util/log.h:41:34: note: in expansion of macro ‘log_cond’
ndctl-79-build/ndctl-79/util/log.h:55:24: note: in expansion of macro ‘log_dbg’
ndctl-79-build/ndctl-79/cxl/lib/libcxl.c:3487:17: note: in expansion of macro ‘dbg’
# 4314|   
# 4315|   	setpart = cmd->input_payload;
# 4316|-> 	setpart->volatile_size = cpu_to_le64(volatile_size)
# 4317|   					/ CXL_CAPACITY_MULTIPLIER;
# 4318|   	return cmd;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def12]
ndctl-79-build/ndctl-79/cxl/memdev.c:1005:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘actx.f_in’
# 1003|   	if (err == argc) {
# 1004|   		usage_with_options(u, options);
# 1005|-> 		return -EINVAL;
# 1006|   	}
# 1007|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def13]
ndctl-79-build/ndctl-79/cxl/memdev.c: scope_hint: In function ‘memdev_action’
ndctl-79-build/ndctl-79/cxl/memdev.c:1005:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘actx.f_out’
# 1003|   	if (err == argc) {
# 1004|   		usage_with_options(u, options);
# 1005|-> 		return -EINVAL;
# 1006|   	}
# 1007|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
ndctl-79-build/ndctl-79/cxl/memdev.c:1005:24: warning[-Wanalyzer-malloc-leak]: leak of ‘actx.f_in’
# 1003|   	if (err == argc) {
# 1004|   		usage_with_options(u, options);
# 1005|-> 		return -EINVAL;
# 1006|   	}
# 1007|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
ndctl-79-build/ndctl-79/cxl/memdev.c:1005:24: warning[-Wanalyzer-malloc-leak]: leak of ‘actx.f_out’
# 1003|   	if (err == argc) {
# 1004|   		usage_with_options(u, options);
# 1005|-> 		return -EINVAL;
# 1006|   	}
# 1007|   

Error: CLANG_WARNING: [#def16]
ndctl-79-build/ndctl-79/cxl/memdev.c:1038:2: warning[deadcode.DeadStores]: Value stored to 'rc' is never read
# 1036|   		ml.log_priority = LOG_INFO;
# 1037|   
# 1038|-> 	rc = 0;
# 1039|   	err = 0;
# 1040|   	count = 0;

Error: CLANG_WARNING: [#def17]
ndctl-79-build/ndctl-79/cxl/port.c:167:2: warning[deadcode.DeadStores]: Value stored to 'rc' is never read
#  165|   		pl.log_priority = LOG_INFO;
#  166|   
#  167|-> 	rc = 0;
#  168|   	count = 0;
#  169|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
ndctl-79-build/ndctl-79/daxctl/acpi.c: scope_hint: In function ‘read_nfit’
ndctl-79-build/ndctl-79/daxctl/acpi.c:159:40: warning[-Wanalyzer-malloc-leak]: leak of ‘ent’
ndctl-79-build/ndctl-79/daxctl/acpi.c: scope_hint: In function ‘read_nfit’
#  157|   	buf = nfit + 1;
#  158|   	while (length) {
#  159|-> 		struct nfit_ent *ent = calloc(1, sizeof(*ent));
#  160|   
#  161|   		if (!ent) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
ndctl-79-build/ndctl-79/daxctl/acpi.c: scope_hint: In function ‘read_srat’
ndctl-79-build/ndctl-79/daxctl/acpi.c:218:40: warning[-Wanalyzer-malloc-leak]: leak of ‘ent’
ndctl-79-build/ndctl-79/daxctl/acpi.c: scope_hint: In function ‘read_srat’
#  216|   	buf = srat + 1;
#  217|   	while (length) {
#  218|-> 		struct srat_ent *ent = calloc(1, sizeof(*ent));
#  219|   
#  220|   		if (!ent) {

Error: CLANG_WARNING: [#def20]
ndctl-79-build/ndctl-79/daxctl/acpi.c:385:2: warning[core.NullDereference]: Dereference of null pointer
#  383|   	LIST_HEAD(mems);
#  384|   
#  385|-> 	list_for_each(&srat->ents, ent, list) {
#  386|   		struct srat_generic *g;
#  387|   		struct srat_cpu *c;

Error: CLANG_WARNING: [#def21]
ndctl-79-build/ndctl-79/daxctl/acpi.c:480:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'ent'
#  478|   	}
#  479|   
#  480|-> 	rc = create_srat(p, srat, &mems);
#  481|   	free_srat_container(srat);
#  482|   	if (rc < 0)

Error: CLANG_WARNING: [#def22]
ndctl-79-build/ndctl-79/daxctl/acpi.c:624:2: warning[core.NullDereference]: Dereference of null pointer
#  622|   	LIST_HEAD(maps);
#  623|   
#  624|-> 	list_for_each(&nfit->ents, ent, list) {
#  625|   		int pxm, type, range_index, region_id;
#  626|   

Error: CLANG_WARNING: [#def23]
ndctl-79-build/ndctl-79/daxctl/daxctl.c:47:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#   45|   	};
#   46|   
#   47|-> 	argc = parse_options_subcommand(argc, argv, builtin_help_options,
#   48|   			builtin_help_subcommands, builtin_help_usage, 0);
#   49|   

Error: CPPCHECK_WARNING: [#def24]
ndctl-79-build/ndctl-79/daxctl/json.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def25]
ndctl-79-build/ndctl-79/daxctl/lib/libdaxctl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def26]
ndctl-79-build/ndctl-79/daxctl/lib/libdaxctl.c:842:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read
#  840|   			break;
#  841|   		}
#  842|-> 		rc = sysfs_write_attr_quiet(ctx, drv_path, devname);
#  843|   		free(drv_path);
#  844|   

Error: CLANG_WARNING: [#def27]
ndctl-79-build/ndctl-79/daxctl/lib/libdaxctl.c:1500:14: warning[deadcode.DeadStores]: Value stored to 'devname' during its initialization is never read
# 1498|   {
# 1499|   	struct daxctl_dev *dev = daxctl_memory_get_dev(mem);
# 1500|-> 	const char *devname = daxctl_dev_get_devname(dev);
# 1501|   	struct daxctl_ctx *ctx = daxctl_dev_get_ctx(dev);
# 1502|   	int rc;

Error: CLANG_WARNING: [#def28]
ndctl-79-build/ndctl-79/daxctl/lib/libdaxctl.c:1501:21: warning[deadcode.DeadStores]: Value stored to 'ctx' during its initialization is never read
# 1499|   	struct daxctl_dev *dev = daxctl_memory_get_dev(mem);
# 1500|   	const char *devname = daxctl_dev_get_devname(dev);
# 1501|-> 	struct daxctl_ctx *ctx = daxctl_dev_get_ctx(dev);
# 1502|   	int rc;
# 1503|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def29]
ndctl-79-build/ndctl-79/ndctl/dimm.c: scope_hint: In function ‘dimm_action’
ndctl-79-build/ndctl-79/ndctl/dimm.c:1329:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘actx.f_in’
# 1327|   	if (err == argc) {
# 1328|   		usage_with_options(u, options);
# 1329|-> 		return -EINVAL;
# 1330|   	}
# 1331|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def30]
ndctl-79-build/ndctl-79/ndctl/dimm.c:1329:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘actx.f_out’
# 1327|   	if (err == argc) {
# 1328|   		usage_with_options(u, options);
# 1329|-> 		return -EINVAL;
# 1330|   	}
# 1331|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
ndctl-79-build/ndctl-79/ndctl/dimm.c:1329:24: warning[-Wanalyzer-malloc-leak]: leak of ‘actx.f_in’
# 1327|   	if (err == argc) {
# 1328|   		usage_with_options(u, options);
# 1329|-> 		return -EINVAL;
# 1330|   	}
# 1331|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
ndctl-79-build/ndctl-79/ndctl/dimm.c:1329:24: warning[-Wanalyzer-malloc-leak]: leak of ‘actx.f_out’
# 1327|   	if (err == argc) {
# 1328|   		usage_with_options(u, options);
# 1329|-> 		return -EINVAL;
# 1330|   	}
# 1331|   

Error: CLANG_WARNING: [#def33]
ndctl-79-build/ndctl-79/ndctl/dimm.c:1422:2: warning[deadcode.DeadStores]: Value stored to 'rc' is never read
# 1420|   	}
# 1421|   
# 1422|-> 	rc = 0;
# 1423|   	err = 0;
# 1424|   	count = 0;

Error: CLANG_WARNING: [#def34]
ndctl-79-build/ndctl-79/ndctl/inject-error.c:298:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller
#  296|   	}
#  297|   
#  298|-> 	return rc;
#  299|   }
#  300|   

Error: CPPCHECK_WARNING: [#def35]
ndctl-79-build/ndctl-79/ndctl/json-smart.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def36]
ndctl-79-build/ndctl-79/ndctl/json.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def37]
ndctl-79-build/ndctl-79/ndctl/keys.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def38]
ndctl-79-build/ndctl-79/ndctl/keys.c:182:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read
#  180|   		*pl = ' ';
#  181|   		pl++;
#  182|-> 		rc = sprintf(pl, "keyhandle=%s", postfix);
#  183|   	}
#  184|   

Error: CPPCHECK_WARNING: [#def39]
ndctl-79-build/ndctl-79/ndctl/lib/hpe1.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def40]
ndctl-79-build/ndctl-79/ndctl/lib/inject.c:364:14: warning[unix.Malloc]: Use of memory after it is freed
#  362|   			merged = 0;
#  363|   
#  364|-> 			bb_next = list_next(h, bb_iter, list);
#  365|   			if (bb_next == NULL)
#  366|   				break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def41]
ndctl-79-build/ndctl-79/ndctl/lib/libndctl.c: scope_hint: In function ‘add_dax’
ndctl-79-build/ndctl-79/ndctl/lib/libndctl.c:5633:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dax’
# 5631|   		return NULL;
# 5632|   
# 5633|-> 	pfn->id = id;
# 5634|   	pfn->region = region;
# 5635|   	if (!__add_pfn(pfn, dax_base)) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def42]
ndctl-79-build/ndctl-79/ndctl/load-keys.c: scope_hint: In function ‘load_keys’
ndctl-79-build/ndctl-79/ndctl/load-keys.c:187:14: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘keypath’ where non-null expected
ndctl-79-build/ndctl-79/ndctl/load-keys.c:7: included_from: Included from here.
/usr/include/unistd.h:517:12: note: argument 1 of ‘chdir’ must be non-null
#  185|   	int rc;
#  186|   
#  187|-> 	rc = chdir(keypath);
#  188|   	if (rc < 0) {
#  189|   		fprintf(stderr, "Change current work dir to %s failed: %s\n",

Error: CLANG_WARNING: [#def43]
ndctl-79-build/ndctl-79/ndctl/load-keys.c:228:2: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  226|   	close(lk_ctx->dirfd);
#  227|    erropen:
#  228|-> 	closedir(lk_ctx->dir);
#  229|   	return rc;
#  230|   }

Error: CLANG_WARNING: [#def44]
ndctl-79-build/ndctl-79/ndctl/ndctl.c:46:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#   44|   	};
#   45|   
#   46|-> 	argc = parse_options_subcommand(argc, argv, builtin_help_options,
#   47|   			builtin_help_subcommands, builtin_help_usage, 0);
#   48|   

Error: CPPCHECK_WARNING: [#def45]
ndctl-79-build/ndctl-79/test/core.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def46]
ndctl-79-build/ndctl-79/test/dax-pmd.c:269:3: warning[deadcode.DeadStores]: Value stored to 'addr' is never read
#  267|   
#  268|   		munmap(addr, 2*align);
#  269|-> 		addr = MAP_FAILED;
#  270|   		unlink(TEST_FILE);
#  271|   		close(fd2);

Error: CLANG_WARNING: [#def47]
ndctl-79-build/ndctl-79/test/dax-pmd.c:272:3: warning[deadcode.DeadStores]: Value stored to 'fd2' is never read
#  270|   		unlink(TEST_FILE);
#  271|   		close(fd2);
#  272|-> 		fd2 = -1;
#  273|   		if (rc)
#  274|   			break;

Error: CLANG_WARNING: [#def48]
ndctl-79-build/ndctl-79/test/dax-poison.c:52:2: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#   50|   	unsigned char *addr = MAP_FAILED;
#   51|   	struct sigaction act;
#   52|-> 	unsigned x = x;
#   53|   	FILE *smaps;
#   54|   	void *buf;

Error: CLANG_WARNING: [#def49]
ndctl-79-build/ndctl-79/test/dax-poison.c:52:11: warning[deadcode.DeadStores]: Value stored to 'x' during its initialization is never read
#   50|   	unsigned char *addr = MAP_FAILED;
#   51|   	struct sigaction act;
#   52|-> 	unsigned x = x;
#   53|   	FILE *smaps;
#   54|   	void *buf;

Error: CLANG_WARNING: [#def50]
ndctl-79-build/ndctl-79/test/dax-poison.c:163:2: warning[deadcode.DeadStores]: Value stored to 'x' is never read
#  161|   
#  162|   	/* check that we can fault in the poison page */
#  163|-> 	x = *(volatile unsigned *) addr + align / 2;
#  164|   	rc = 0;
#  165|   

Error: CPPCHECK_WARNING: [#def51]
ndctl-79-build/ndctl-79/test/daxdev-errors.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def52]
ndctl-79-build/ndctl-79/test/dsm-fail.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def53]
ndctl-79-build/ndctl-79/test/libndctl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def54]
ndctl-79-build/ndctl-79/test/libndctl.c:659:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read
#  657|   	if (namespace->ro) {
#  658|   		ndctl_region_set_ro(region, 0);
#  659|-> 		rc = ndctl_dax_enable(dax);
#  660|   		fprintf(stderr, "%s: failed to enable after setting rw\n",
#  661|   				devname);

Error: CLANG_WARNING: [#def55]
ndctl-79-build/ndctl-79/test/libndctl.c:770:3: warning[deadcode.DeadStores]: Value stored to 'rc' is never read
#  768|   	if (namespace->ro) {
#  769|   		ndctl_region_set_ro(region, 0);
#  770|-> 		rc = ndctl_pfn_enable(pfn);
#  771|   		fprintf(stderr, "%s: failed to enable after setting rw\n",
#  772|   				devname);

Error: CLANG_WARNING: [#def56]
ndctl-79-build/ndctl-79/test/libndctl.c:996:4: warning[deadcode.DeadStores]: Value stored to 'rc' is never read
#  994|   		if (namespace->ro) {
#  995|   			ndctl_region_set_ro(region, 0);
#  996|-> 			rc = ndctl_btt_enable(btt);
#  997|   			fprintf(stderr, "%s: failed to enable after setting rw\n",
#  998|   					devname);

Error: CLANG_WARNING: [#def57]
ndctl-79-build/ndctl-79/test/libndctl.c:1799:7: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value
# 1797|   		}
# 1798|   
# 1799|-> 		if (rc)
# 1800|   			break;
# 1801|   	}

Error: CPPCHECK_WARNING: [#def58]
ndctl-79-build/ndctl-79/test/mmap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def59]
ndctl-79-build/ndctl-79/test/mmap.c:64:6: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#   62|   	for (i=0, wp=p; i<(size/sizeof(*wp)); i++)
#   63|   		tmp = *wp++;
#   64|-> 	tmp = tmp;
#   65|   	timeval = stop();
#   66|   	printf("Read : %10llu usec\n", timeval);

Error: CLANG_WARNING: [#def60]
ndctl-79-build/ndctl-79/test/mmap.c:157:6: warning[unix.Malloc]: Use of memory after it is freed
#  155|   
#  156|   	printf("> mmap mprot 0x%x flags 0x%x\n", mprot, mflags);
#  157|-> 	p = mmap(mptr, size, mprot, mflags, fd, 0x0);
#  158|   	if (!p) {
#  159|   		perror("mmap failed");

Error: CPPCHECK_WARNING: [#def61]
ndctl-79-build/ndctl-79/test/pmem_namespaces.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def62]
ndctl-79-build/ndctl-79/test/smart-listen.c:45:13: warning[unix.Malloc]: Use of memory allocated with size zero
#   43|   		p = &poll_ents[i++];
#   44|   		p->fd = fd;
#   45|-> 		dimms[fd] = dimm;
#   46|   		if (i > count) {
#   47|   			fprintf(stderr, "dimm count changed!?\n");

Error: CLANG_WARNING: [#def63]
ndctl-79-build/ndctl-79/test/smart-listen.c:55:10: warning[unix.Malloc]: Use of memory allocated with size zero
#   53|   	for (i = 0; i < count; i++) {
#   54|   		p = &poll_ents[i];
#   55|-> 		dimm = dimms[p->fd];
#   56|   		if (pread(p->fd, &buf, 1, 0) != 1) {
#   57|   			fprintf(stderr, "%s: failed to read\n",

Error: GCC_ANALYZER_WARNING (CWE-688): [#def64]
ndctl-79-build/ndctl-79/util/parse-options.c: scope_hint: In function ‘get_value’
ndctl-79-build/ndctl-79/util/parse-options.c:151:38: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected
/usr/include/features.h:511: included_from: Included from here.
/usr/include/bits/libc-header-start.h:33: included_from: Included from here.
/usr/include/stdio.h:28: included_from: Included from here.
ndctl-79-build/ndctl-79/util/parse-options.c:6: included_from: Included from here.
/usr/include/stdlib.h:215:17: note: argument 1 of ‘strtol’ must be non-null
#  149|   		if (get_arg(p, opt, flags, &arg))
#  150|   			return -1;
#  151|-> 		*(int *)opt->value = strtol(arg, (char **)&s, 10);
#  152|   		if (*s)
#  153|   			return opterror(opt, "expects a numerical value", flags);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def65]
ndctl-79-build/ndctl-79/util/parse-options.c:167:47: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected
/usr/include/stdlib.h:215:17: note: argument 1 of ‘strtol’ must be non-null
#  165|   		if (get_arg(p, opt, flags, &arg))
#  166|   			return -1;
#  167|-> 		*(unsigned int *)opt->value = strtol(arg, (char **)&s, 10);
#  168|   		if (*s)
#  169|   			return opterror(opt, "expects a numerical value", flags);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def66]
ndctl-79-build/ndctl-79/util/parse-options.c:183:39: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected
/usr/include/stdlib.h:215:17: note: argument 1 of ‘strtol’ must be non-null
#  181|   		if (get_arg(p, opt, flags, &arg))
#  182|   			return -1;
#  183|-> 		*(long *)opt->value = strtol(arg, (char **)&s, 10);
#  184|   		if (*s)
#  185|   			return opterror(opt, "expects a numerical value", flags);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def67]
ndctl-79-build/ndctl-79/util/parse-options.c:199:43: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected
/usr/include/stdlib.h:243:31: note: argument 1 of ‘strtoull’ must be non-null
#  197|   		if (get_arg(p, opt, flags, &arg))
#  198|   			return -1;
#  199|-> 		*(uint64_t *)opt->value = strtoull(arg, (char **)&s, 10);
#  200|   		if (*s)
#  201|   			return opterror(opt, "expects a numerical value", flags);

Error: CLANG_WARNING: [#def68]
ndctl-79-build/ndctl-79/util/strbuf.c:78:2: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
#   76|   			sb->buf + pos + len,
#   77|   			sb->len - pos - len);
#   78|-> 	memcpy(sb->buf + pos, data, dlen);
#   79|   	strbuf_setlen(sb, sb->len + dlen - len);
#   80|   }

Error: CPPCHECK_WARNING: [#def69]
ndctl-79-build/ndctl-79/util/sysfs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-33.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namendctl-79-2.fc41
store-results-to/tmp/tmptdt9ku98/ndctl-79-2.fc41.tar.xz
time-created2024-07-03 16:21:08
time-finished2024-07-03 16:23:17
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmptdt9ku98/ndctl-79-2.fc41.tar.xz' '--gcc-analyze' '/tmp/tmptdt9ku98/ndctl-79-2.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9