rdma-core-48.0-4.fc40
List of Defects
Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:185:23: warning[-Wanalyzer-malloc-leak]: leak of ‘create_range(astart + length, rend - astart - length)’
rdma-core-48.0-build/rdma-core-48.0/util/interval_set.c: scope_hint: In function ‘iset_alloc_range’
rdma-core-48.0-build/rdma-core-48.0/util/interval_set.c: scope_hint: In function ‘iset_alloc_range’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:738:9: note: in expansion of macro ‘list_for_each_off_dir_’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:524:9: note: in expansion of macro ‘list_for_each_off’
rdma-core-48.0-build/rdma-core-48.0/util/interval_set.c:169:9: note: in expansion of macro ‘list_for_each’
rdma-core-48.0-build/rdma-core-48.0/util/interval_set.c:200:25: note: in expansion of macro ‘list_add_after’
rdma-core-48.0-build/rdma-core-48.0/util/interval_set.c:200:25: note: in expansion of macro ‘list_add_after’
# 183| n->next = p->next;
# 184| n->prev = p;
# 185|-> p->next->prev = n;
# 186| p->next = n;
# 187| (void)list_debug(h, abortstr);
Error: CLANG_WARNING: [#def2]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_matcher.c:34: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/mlx5dv_dr.h:36: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:234:16: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from field 'prev')
# 232| n->next = p;
# 233| n->prev = p->prev;
# 234|-> p->prev->next = n;
# 235| p->prev = n;
# 236| (void)list_debug(h, abortstr);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:234:23: warning[-Wanalyzer-malloc-leak]: leak of ‘create_range(start, length)’
rdma-core-48.0-build/rdma-core-48.0/util/interval_set.c: scope_hint: In function ‘iset_insert_range’
rdma-core-48.0-build/rdma-core-48.0/util/interval_set.c:140:25: note: in expansion of macro ‘list_add_tail’
rdma-core-48.0-build/rdma-core-48.0/util/interval_set.c:140:25: note: in expansion of macro ‘list_add_tail’
# 232| n->next = p;
# 233| n->prev = p->prev;
# 234|-> p->prev->next = n;
# 235| p->prev = n;
# 236| (void)list_debug(h, abortstr);
Error: GCC_ANALYZER_WARNING (CWE-416): [#def4]
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:327:10: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘mapped_ports.n.next’
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c: scope_hint: In function ‘free_iwpm_mapped_ports’
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c:518:29: note: in expansion of macro ‘list_pop’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h: scope_hint: In function ‘free_iwpm_mapped_ports’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:482:9: note: in expansion of macro ‘list_del’
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c: scope_hint: In function ‘free_iwpm_mapped_ports’
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c:518:29: note: in expansion of macro ‘list_pop’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h: scope_hint: In function ‘free_iwpm_mapped_ports’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:482:9: note: in expansion of macro ‘list_del’
# 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: [#def5]
rdma-core-48.0-build/rdma-core-48.0/ccan/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: [#def6]
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:328:16: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from field 'prev')
# 326| (void)list_debug_node(n, abortstr);
# 327| n->next->prev = n->prev;
# 328|-> n->prev->next = n->next;
# 329| #ifdef CCAN_LIST_DEBUG
# 330| /* Catch use-after-del. */
Error: CLANG_WARNING: [#def7]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c:34: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm.h:54: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:482:2: warning[unix.Malloc]: Use of memory after it is freed
# 480| return NULL;
# 481| n = h->n.next;
# 482|-> list_del(n);
# 483| return (const char *)n - off;
# 484| }
Error: GCC_ANALYZER_WARNING (CWE-416): [#def8]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/mlx5dv_dr.h:36: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_action.c:36: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_action.c: scope_hint: In function ‘dr_action_remove_action_members’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:705:15: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘tmp’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:768:9: note: in expansion of macro ‘list_for_each_safe_off_dir_’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:582:9: note: in expansion of macro ‘list_for_each_safe_off’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_action.c:2848:9: note: in expansion of macro ‘list_for_each_safe’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/mlx5dv_dr.h:39: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:768:9: note: in expansion of macro ‘list_for_each_safe_off_dir_’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:582:9: note: in expansion of macro ‘list_for_each_safe_off’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_action.c:2848:9: note: in expansion of macro ‘list_for_each_safe’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_action.c:2849:17: note: in expansion of macro ‘list_del’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_action.c: scope_hint: In function ‘dr_action_remove_action_members’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:768:9: note: in expansion of macro ‘list_for_each_safe_off_dir_’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:582:9: note: in expansion of macro ‘list_for_each_safe_off’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_action.c:2848:9: note: in expansion of macro ‘list_for_each_safe’
# 703| list_node_from_off_(i, (off)) != &(h)->n; \
# 704| i = nxt, \
# 705|-> nxt = list_node_to_off_(list_node_from_off_(i, (off))->dir, \
# 706| (off)))
# 707|
Error: GCC_ANALYZER_WARNING (CWE-126): [#def9]
rdma-core-48.0-build/rdma-core-48.0/ibacm/prov/acmp/src/acmp.c: scope_hint: In function ‘acmp_parse_hosts_file’
rdma-core-48.0-build/rdma-core-48.0/ibacm/prov/acmp/src/acmp.c:2324:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
rdma-core-48.0-build/rdma-core-48.0/ibacm/prov/acmp/src/acmp.c:61: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/ibacm/prov/acmp/src/acmp.c:2310:17: note: in expansion of macro ‘acm_log’
rdma-core-48.0-build/rdma-core-48.0/ibacm/prov/acmp/src/acmp.c:2324:25: note: read of 18 bytes from after the end of ‘addr’
rdma-core-48.0-build/rdma-core-48.0/ibacm/prov/acmp/src/acmp.c:2324:25: note: valid subscripts for ‘addr’ are ‘[0]’ to ‘[45]’
# └──────────────────────────────────────────────────────────────────────┘
# ^ ^ ^ ^
# 2322| } else {
# 2323| addr_type = ACM_ADDRESS_NAME;
# 2324|-> strncpy((char *)name, addr, ACM_MAX_ADDRESS);
# 2325| }
# 2326|
Error: GCC_ANALYZER_WARNING (CWE-688): [#def10]
rdma-core-48.0-build/rdma-core-48.0/ibacm/src/acme.c: scope_hint: In function ‘parse_perf_arg’
rdma-core-48.0-build/rdma-core-48.0/ibacm/src/acme.c:1026:14: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected
rdma-core-48.0-build/rdma-core-48.0/ibacm/src/acme.c: scope_hint: In function ‘parse_perf_arg’
rdma-core-48.0-build/rdma-core-48.0/ibacm/src/acme.c: scope_hint: In function ‘parse_perf_arg’
/usr/include/string.h:462: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/ibacm/src/acme.c:35: included_from: Included from here.
/usr/include/strings.h:120:12: note: argument 2 of ‘strncasecmp’ must be non-null
# 1024| static void parse_perf_arg(char *arg)
# 1025| {
# 1026|-> if (!strncasecmp("col", arg, 3)) {
# 1027| perf_query = PERF_QUERY_COL;
# 1028| } else if (!strncasecmp("all", arg, 3)) {
Error: GCC_ANALYZER_WARNING (CWE-688): [#def11]
rdma-core-48.0-build/rdma-core-48.0/ibacm/src/parse.c: scope_hint: In function ‘expand’
rdma-core-48.0-build/rdma-core-48.0/ibacm/src/parse.c:58:25: warning[-Wanalyzer-null-argument]: use of NULL ‘str_buf’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
# 56| snprintf(buf, sizeof buf, "%s%0*d", basename, width, from);
# 57| str_buf = realloc(str_buf, size + strlen(buf)+1);
# 58|-> strcpy(&str_buf[size], buf);
# 59|
# 60| from++;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
rdma-core-48.0-build/rdma-core-48.0/ibacm/src/parse.c:62:30: warning[-Wanalyzer-malloc-leak]: leak of ‘str_buf’
# 60| from++;
# 61| cnt++;
# 62|-> size += strlen(buf)+1;
# 63| }
# 64|
Error: GCC_ANALYZER_WARNING (CWE-688): [#def13]
rdma-core-48.0-build/rdma-core-48.0/ibacm/src/parse.c: scope_hint: In function ‘parse’
rdma-core-48.0-build/rdma-core-48.0/ibacm/src/parse.c:95:28: warning[-Wanalyzer-null-argument]: use of NULL ‘token’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
# 93|
# 94| if (!next) {
# 95|-> str_size = strlen(token) + 1;
# 96| str_buf = malloc(str_size);
# 97| if (!str_buf)
Error: GCC_ANALYZER_WARNING (CWE-131): [#def14]
rdma-core-48.0-build/rdma-core-48.0/ibacm/src/parse.c:106:16: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
# 104| }
# 105|
# 106|-> ptrs = malloc((sizeof str_buf * (cnt + 1)) + str_size);
# 107| if (!ptrs)
# 108| goto out_str_buf;
Error: GCC_ANALYZER_WARNING (CWE-688): [#def15]
rdma-core-48.0-build/rdma-core-48.0/ibacm/src/parse.c:110:9: warning[-Wanalyzer-null-argument]: use of NULL ‘str_buf’ where non-null expected
<built-in>: note: argument 2 of ‘__builtin_memcpy’ must be non-null
# 108| goto out_str_buf;
# 109|
# 110|-> memcpy(&ptrs[cnt + 1], str_buf, str_size);
# 111|
# 112| ptrs[0] = (char*) &ptrs[cnt + 1];
Error: CPPCHECK_WARNING: [#def16]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/dump_fts.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING (CWE-457): [#def17]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/dump_fts.c:165: error[uninitvar]: Uninitialized variable: str
# 163| }
# 164| *s = 0;
# 165|-> printf(" %s\n", str);
# 166| }
# 167| for (i = 0, s = str; i <= nports; i++)
Error: CPPCHECK_WARNING: [#def18]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibaddr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def19]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibcacheedit.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def20]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibcacheedit.c:271:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
# 269| NULL);
# 270|
# 271|-> argc -= optind;
# 272| argv += optind;
# 273|
Error: CPPCHECK_WARNING: [#def21]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibccconfig.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def22]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibccconfig.c:615:13: warning[core.CallAndMessage]: Called function pointer is null (null dereference)
# 613| ibd_dest_type, ibd_sm_id, srcport) < 0)
# 614| IBEXIT("can't resolve destination %s", argv[1]);
# 615|-> if ((err = fn(&portid, argv + 2, argc - 2)))
# 616| IBEXIT("operation %s: %s", argv[0], err);
# 617|
Error: CPPCHECK_WARNING: [#def23]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibccquery.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def24]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibccquery.c:403:13: warning[core.CallAndMessage]: Called function pointer is null (null dereference)
# 401| ibd_dest_type, ibd_sm_id, srcport) < 0)
# 402| IBEXIT("can't resolve destination %s", argv[1]);
# 403|-> if ((err = fn(&portid, argv + 2, argc - 2)))
# 404| IBEXIT("operation %s: %s", argv[0], err);
# 405|
Error: CPPCHECK_WARNING: [#def25]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibdiag_common.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def26]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibdiag_common.c:179:17: warning[deadcode.DeadStores]: Value stored to 'o' during its initialization is never read
# 177| void ibdiag_show_usage(void)
# 178| {
# 179|-> struct option *o = long_opts;
# 180| int n;
# 181|
Error: GCC_ANALYZER_WARNING (CWE-121): [#def27]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibdiag_common.c: scope_hint: In function ‘vsnprint_field’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibdiag_common.c:894:24: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibdiag_common.c:894:24: note: write of 1 byte to beyond the end of ‘buf’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibdiag_common.c:894:24: note: valid subscripts for ‘buf’ are ‘[0]’ to ‘[1023]’
# 892| ret = vsnprintf(&buf[spacing+1], n - spacing, format, va_args);
# 893| if (ret >= n - spacing)
# 894|-> buf[n] = '\0';
# 895|
# 896| return ret + spacing;
Error: CPPCHECK_WARNING (CWE-401): [#def28]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibdiag_sa.c:139: error[memleakOnRealloc]: Common realloc mistake: 'umad' nulled but not freed upon failure
# 137| if (ret < 0) {
# 138| if (errno == ENOSPC) {
# 139|-> umad = realloc(umad, umad_size() + len);
# 140| goto recv_mad;
# 141| }
Error: CPPCHECK_WARNING: [#def29]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/iblinkinfo.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-476): [#def30]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/iblinkinfo.c: scope_hint: In function ‘print_node_header.part.0’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/iblinkinfo.c:299:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘out_header_flag’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/iblinkinfo.c: scope_hint: In function ‘print_node_header.part.0’
# 297| out_prefix ? out_prefix : "",
# 298| nodetype_str(node), remap);
# 299|-> (*out_header_flag)++;
# 300| free(remap);
# 301| }
Error: CLANG_WARNING: [#def31]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/iblinkinfo.c:646:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
# 644| process_opt, usage_args, NULL);
# 645|
# 646|-> argc -= optind;
# 647| argv += optind;
# 648|
Error: CLANG_WARNING: [#def32]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/iblinkinfo.c:647:2: warning[deadcode.DeadStores]: Value stored to 'argv' is never read
# 645|
# 646| argc -= optind;
# 647|-> argv += optind;
# 648|
# 649| ibmad_port = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
Error: CPPCHECK_WARNING: [#def33]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibnetdiscover.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-787): [#def34]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibnetdiscover.c: scope_hint: In function ‘node_name’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibnetdiscover.c:176:9: warning[-Wanalyzer-out-of-bounds]: buffer overflow
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibnetdiscover.c:176:9: note: write of 2 bytes to beyond the end of ‘buf’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibnetdiscover.c:176:9: note: valid subscripts for ‘buf’ are ‘[0]’ to ‘[255]’
# 174| break;
# 175| }
# 176|-> sprintf(buf + 2, "-%016" PRIx64 "\"", node->guid);
# 177|
# 178| return buf;
Error: CLANG_WARNING: [#def35]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibnetdiscover.c:391:3: warning[deadcode.DeadStores]: Value stored to 'cap_mask' is never read
# 389|
# 390| if (!port->node->ports[0]) {
# 391|-> cap_mask = 0;
# 392| ispeed = 0;
# 393| espeed = 0;
Error: CLANG_WARNING: [#def36]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibnetdiscover.c:562:3: warning[core.NullDereference]: Access to field 'from_node' results in a dereference of a null pointer (loaded from variable 'fabric')
# 560| fabric->maxhops_discovered, fabric->total_mads_used);
# 561| fprintf(f, "# Initiated from node %016" PRIx64 " port %016" PRIx64 "\n",
# 562|-> fabric->from_node->guid,
# 563| mad_get_field64(fabric->from_node->info, 0,
# 564| IB_NODE_PORT_GUID_F));
Error: GCC_ANALYZER_WARNING (CWE-476): [#def37]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibnetdiscover.c: scope_hint: In function ‘dump_topology’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibnetdiscover.c:563:39: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘fabric’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibnetdiscover.c:50: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibnetdiscover.c:1135:25: note: in expansion of macro ‘IBEXIT’
# 561| fprintf(f, "# Initiated from node %016" PRIx64 " port %016" PRIx64 "\n",
# 562| fabric->from_node->guid,
# 563|-> mad_get_field64(fabric->from_node->info, 0,
# 564| IB_NODE_PORT_GUID_F));
# 565|
Error: CPPCHECK_WARNING: [#def38]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibping.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-479): [#def39]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibping.c:154:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘printf’ from within signal handler
# 152| DEBUG("out due signal %d", sig);
# 153|
# 154|-> printf("\n--- %s (%s) ibping statistics ---\n", last_host,
# 155| portid2str(&portid));
# 156| printf("%" PRIu64 " packets transmitted, %" PRIu64 " received, %" PRIu64
Error: GCC_ANALYZER_WARNING (CWE-479): [#def40]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibping.c:156:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘printf’ from within signal handler
# 154| printf("\n--- %s (%s) ibping statistics ---\n", last_host,
# 155| portid2str(&portid));
# 156|-> printf("%" PRIu64 " packets transmitted, %" PRIu64 " received, %" PRIu64
# 157| "%% packet loss, time %" PRIu64 " ms\n", ntrans, replied,
# 158| (lost != 0) ? lost * 100 / ntrans : 0, total_time / 1000);
Error: GCC_ANALYZER_WARNING (CWE-479): [#def41]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibping.c:159:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘printf’ from within signal handler
# 157| "%% packet loss, time %" PRIu64 " ms\n", ntrans, replied,
# 158| (lost != 0) ? lost * 100 / ntrans : 0, total_time / 1000);
# 159|-> printf("rtt min/avg/max = %" PRIu64 ".%03" PRIu64 "/%" PRIu64 ".%03"
# 160| PRIu64 "/%" PRIu64 ".%03" PRIu64 " ms\n",
# 161| minrtt == ~0ull ? 0 : minrtt / 1000,
Error: GCC_ANALYZER_WARNING (CWE-479): [#def42]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibping.c:167:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibping.c:167:9: note: ‘_exit’ is a possible signal-safe alternative for ‘exit’
# 165| maxrtt % 1000);
# 166|
# 167|-> exit(0);
# 168| }
# 169|
Error: CPPCHECK_WARNING: [#def43]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibportstate.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def44]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibqueryerrors.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-465): [#def45]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibqueryerrors.c: scope_hint: In function ‘set_thres’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibqueryerrors.c:116:28: warning[-Wanalyzer-deref-before-check]: check of ‘threshold_str’ for NULL after already dereferencing it
# 114| threshold_str = realloc(threshold_str,
# 115| strlen(threshold_str)+strlen(tmp)+1);
# 116|-> if (!threshold_str) {
# 117| fprintf(stderr, "Failed to allocate memory: "
# 118| "%s\n", strerror(errno));
Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibqueryerrors.c: scope_hint: In function ‘set_thresholds’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibqueryerrors.c:142:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(threshold_file, "r")’
# 140| snprintf(str, 63, "Thresholds: ");
# 141| threshold_str = malloc(strlen(str)+1);
# 142|-> if (!threshold_str) {
# 143| fprintf(stderr, "Failed to allocate memory: %s\n",
# 144| strerror(errno));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibqueryerrors.c:142:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(threshold_file, "r")’
# 140| snprintf(str, 63, "Thresholds: ");
# 141| threshold_str = malloc(strlen(str)+1);
# 142|-> if (!threshold_str) {
# 143| fprintf(stderr, "Failed to allocate memory: %s\n",
# 144| strerror(errno));
Error: CLANG_WARNING: [#def48]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibqueryerrors.c:402:14: warning[deadcode.DeadStores]: Value stored to 'unit' during its initialization is never read
# 400| int is_exceeds = 0;
# 401| float val = 0;
# 402|-> const char *unit = "";
# 403|
# 404| if (htonl(cap_mask2) & IB_PM_IS_ADDL_PORT_CTRS_EXT_SUP) {
Error: CLANG_WARNING: [#def49]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibqueryerrors.c:492:17: warning[deadcode.DeadStores]: Value stored to 'unit' during its initialization is never read
# 490| uint64_t val64 = 0;
# 491| float val = 0;
# 492|-> const char *unit = "";
# 493| mad_decode_field(pkt, i, (void *)&val64);
# 494| if (val64) {
Error: CLANG_WARNING: [#def50]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibqueryerrors.c:617:15: warning[deadcode.DeadStores]: Value stored to 'unit' during its initialization is never read
# 615| uint64_t val64 = 0;
# 616| float val = 0;
# 617|-> const char *unit = "";
# 618| int data = 0;
# 619| mad_decode_field(pc, i, (void *)&val64);
Error: CLANG_WARNING: [#def51]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibqueryerrors.c:1028:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
# 1026| usage_args, NULL);
# 1027|
# 1028|-> argc -= optind;
# 1029| argv += optind;
# 1030|
Error: CPPCHECK_WARNING: [#def52]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibroute.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING (CWE-457): [#def53]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibroute.c:191: error[uninitvar]: Uninitialized variable: str
# 189| }
# 190| *s = 0;
# 191|-> printf(" %s\n", str);
# 192| }
# 193| for (i = 0, s = str; i <= nports; i++)
Error: CPPCHECK_WARNING: [#def54]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibstat.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def55]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibsysstat.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def56]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibtracert.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def57]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibtracert.c:138:2: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 136| char *s, *e;
# 137|
# 138|-> memset(ni, 0, sizeof(node->nodeinfo));
# 139| if (!smp_query_via(ni, portid, IB_ATTR_NODE_INFO, 0, timeout, srcport))
# 140| return -1;
Error: CLANG_WARNING: [#def58]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibtracert.c:153:2: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 151| }
# 152|
# 153|-> memset(pi, 0, sizeof(port->portinfo));
# 154| if (!smp_query_via(pi, portid, IB_ATTR_PORT_INFO, 0, timeout, srcport))
# 155| return -1;
Error: CLANG_WARNING: [#def59]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibtracert.c:435:16: warning[core.NullDereference]: Access to field 'portnum' results in a dereference of a null pointer (loaded from variable 'port')
# 433| void *pi = portinfo;
# 434|
# 435|-> port->portnum = portnum;
# 436|
# 437| if (!smp_query_via(pi, portid, IB_ATTR_PORT_INFO, portnum, timeout,
Error: CLANG_WARNING: [#def60]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibtracert.c:460:6: warning[core.NullDereference]: Access to field 'portguid' results in a dereference of a null pointer (loaded from variable 'port')
# 458| static int new_node(Node * node, Port * port, ib_portid_t * path, int dist)
# 459| {
# 460|-> if (port->portguid == target_portguid) {
# 461| node->dist = -1; /* tag as target */
# 462| link_port(port, node);
Error: CLANG_WARNING: [#def61]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibtracert.c:558:15: warning[core.NullDereference]: Access to field 'upnode' results in a dereference of a null pointer (loaded from variable 'node')
# 556| }
# 557|
# 558|-> node->upnode = NULL; /* root */
# 559| if ((r = new_node(node, port, from, 0)) > 0) {
# 560| if (node->type != IB_NODE_SWITCH) {
Error: CLANG_WARNING: [#def62]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibtracert.c:559:7: warning[deadcode.DeadStores]: Although the value stored to 'r' is used in the enclosing expression, the value is never actually read from 'r'
# 557|
# 558| node->upnode = NULL; /* root */
# 559|-> if ((r = new_node(node, port, from, 0)) > 0) {
# 560| if (node->type != IB_NODE_SWITCH) {
# 561| IBWARN("ibtracert from CA to CA is unsupported");
Error: CLANG_WARNING: [#def63]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibtracert.c:656:24: warning[core.NullDereference]: Access to field 'upnode' results in a dereference of a null pointer (loaded from variable 'remotenode')
# 654| }
# 655|
# 656|-> remotenode->upnode = node;
# 657| remotenode->upport = remoteport->portnum;
# 658| remoteport->remoteport = port;
Error: CLANG_WARNING: [#def64]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibtracert.c:657:26: warning[core.NullDereference]: Access to field 'portnum' results in a dereference of a null pointer (loaded from variable 'remoteport')
# 655|
# 656| remotenode->upnode = node;
# 657|-> remotenode->upport = remoteport->portnum;
# 658| remoteport->remoteport = port;
# 659|
Error: CPPCHECK_WARNING: [#def65]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/mcm_rereg_test.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def66]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/perfquery.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def67]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/saquery.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING (CWE-758): [#def68]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/saquery.c:975: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 973| attr.port_info.capability_mask = capability_mask;
# 974|
# 975|-> return get_any_records(h, IB_SA_ATTR_PORTINFORECORD, 1 << 31,
# 976| IB_PIR_COMPMASK_CAPMASK, &attr, sizeof(attr), result);
# 977| }
Error: GCC_ANALYZER_WARNING (CWE-688): [#def69]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/saquery.c: scope_hint: In function ‘process_opt’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/saquery.c:1530:35: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘src_lid’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strchr’ must be non-null
# 1528| {
# 1529| src_lid = strdup(optarg);
# 1530|-> dst_lid = strchr(src_lid, ':');
# 1531| if (!dst_lid)
# 1532| ibdiag_show_usage();
Error: GCC_ANALYZER_WARNING (CWE-688): [#def70]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/saquery.c:1541:42: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘src_addr’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strchr’ must be non-null
# 1539| {
# 1540| char *src_addr = strdup(optarg);
# 1541|-> char *dst_addr = strchr(src_addr, '-');
# 1542| if (!dst_addr)
# 1543| ibdiag_show_usage();
Error: CLANG_WARNING: [#def71]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/saquery.c:1544:16: warning[core.NullDereference]: Dereference of null pointer
# 1542| if (!dst_addr)
# 1543| ibdiag_show_usage();
# 1544|-> *dst_addr++ = '\0';
# 1545| if (inet_pton(AF_INET6, src_addr, &p->sgid) <= 0)
# 1546| ibdiag_show_usage();
Error: GCC_ANALYZER_WARNING (CWE-476): [#def72]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/saquery.c:1544:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dst_addr’
# 1542| if (!dst_addr)
# 1543| ibdiag_show_usage();
# 1544|-> *dst_addr++ = '\0';
# 1545| if (inet_pton(AF_INET6, src_addr, &p->sgid) <= 0)
# 1546| ibdiag_show_usage();
Error: CLANG_WARNING: [#def73]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/sminfo.c:136:9: warning[deadcode.DeadStores]: Although the value stored to 'p' is used in the enclosing expression, the value is never actually read from 'p'
# 134|
# 135| if (mod) {
# 136|-> if (!(p = smp_set_via(sminfo, &portid, IB_ATTR_SMINFO, mod,
# 137| ibd_timeout, srcport)))
# 138| IBEXIT("query");
Error: CLANG_WARNING: [#def74]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/sminfo.c:139:15: warning[deadcode.DeadStores]: Although the value stored to 'p' is used in the enclosing expression, the value is never actually read from 'p'
# 137| ibd_timeout, srcport)))
# 138| IBEXIT("query");
# 139|-> } else if (!(p = smp_query_via(sminfo, &portid, IB_ATTR_SMINFO, 0,
# 140| ibd_timeout, srcport)))
# 141| IBEXIT("query");
Error: CPPCHECK_WARNING: [#def75]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/smpdump.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def76]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/smpdump.c:99:55: warning[core.UndefinedBinaryOperatorResult]: The left operand of '+' is a garbage value
# 97|
# 98| if (path)
# 99|-> memcpy(smp->initial_path, path->path, path->hop_cnt + 1);
# 100|
# 101| smp->hop_cnt = (uint8_t) path->hop_cnt;
Error: CPPCHECK_WARNING: [#def77]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/smpquery.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def78]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/smpquery.c:490:14: warning[core.CallAndMessage]: Called function pointer is null (null dereference)
# 488| ibd_dest_type, ibd_sm_id, srcport) < 0)
# 489| IBEXIT("can't resolve destination port %s", argv[1]);
# 490|-> if ((err = fn(&portid, argv + 2, argc - 2)))
# 491| IBEXIT("operation %s: %s", argv[0], err);
# 492| } else {
Error: CLANG_WARNING: [#def79]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/smpquery.c:500:14: warning[core.CallAndMessage]: Called function pointer is null (null dereference)
# 498| ibd_dest_type, ibd_sm_id, srcport) < 0)
# 499| IBEXIT("can't resolve destination port %s", concat);
# 500|-> if ((err = fn(&portid, argv + 3, argc - 3)))
# 501| IBEXIT("operation %s: %s", argv[0], err);
# 502| }
Error: CPPCHECK_WARNING: [#def80]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/vendstat.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def81]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_common.c:269:2: warning[deadcode.DeadStores]: Value stored to 'pm_sock' is never read
# 267| if (pm_sock >= 0)
# 268| close(pm_sock);
# 269|-> pm_sock = -1;
# 270| }
# 271|
Error: CLANG_WARNING: [#def82]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c:190:14: warning[deadcode.DeadStores]: Value stored to 'str_err' during its initialization is never read
# 188| socklen_t sockname_len;
# 189| __be16 *new_port = NULL, *mapped_port = NULL;
# 190|-> const char *str_err = "";
# 191|
# 192| /* create a socket */
Error: GCC_ANALYZER_WARNING (CWE-775): [#def83]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c: scope_hint: In function ‘get_iwpm_tcp_port’
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c:226:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘socket((int)addr_family, 1, 0)’
# 224| }
# 225|
# 226|-> if (bind(*new_sock, &bind_addr.sock_addr, sizeof(bind_addr))) {
# 227| str_err = "Unable to bind the socket";
# 228| goto get_tcp_port_error;
Error: GCC_ANALYZER_WARNING (CWE-775): [#def84]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c: scope_hint: In function ‘create_iwpm_mapped_port’
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c:293:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘new_sd’
# 291| }
# 292| iwpm_port = get_iwpm_port(client_idx, local_addr, &mapped_addr, new_sd);
# 293|-> return iwpm_port;
# 294|
# 295| create_mapped_port_error:
Error: CLANG_WARNING: [#def85]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c:312:14: warning[deadcode.DeadStores]: Value stored to 'str_err' during its initialization is never read
# 310| iwpm_mapped_port *iwpm_port;
# 311| int new_sd = -1;
# 312|-> const char *str_err = "";
# 313|
# 314| if (local_addr->ss_family != mapped_addr->ss_family) {
Error: CLANG_WARNING: [#def86]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c:315:3: warning[deadcode.DeadStores]: Value stored to 'str_err' is never read
# 313|
# 314| if (local_addr->ss_family != mapped_addr->ss_family) {
# 315|-> str_err = "Different local and mapped sockaddr families";
# 316| goto reopen_mapped_port_error;
# 317| }
Error: GCC_ANALYZER_WARNING (CWE-775): [#def87]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c: scope_hint: In function ‘reopen_iwpm_mapped_port’
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c:323:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘new_sd’
# 321| }
# 322| iwpm_port = get_iwpm_port(client_idx, local_addr, mapped_addr, new_sd);
# 323|-> return iwpm_port;
# 324|
# 325| reopen_mapped_port_error:
Error: GCC_ANALYZER_WARNING (CWE-1341): [#def88]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c: scope_hint: In function ‘free_iwpm_port’
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c:447:17: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘*iwpm_port.sd’
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c:518:29: note: in expansion of macro ‘list_pop’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h: scope_hint: In function ‘free_iwpm_port’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:482:9: note: in expansion of macro ‘list_del’
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c: scope_hint: In function ‘free_iwpm_port’
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c:518:29: note: in expansion of macro ‘list_pop’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h: scope_hint: In function ‘free_iwpm_port’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:482:9: note: in expansion of macro ‘list_del’
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c: scope_hint: In function ‘free_iwpm_port’
# 445| {
# 446| if (iwpm_port->sd != -1)
# 447|-> close(iwpm_port->sd);
# 448| free(iwpm_port);
# 449| }
Error: CPPCHECK_WARNING (CWE-401): [#def89]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_helper.c:508: error[memleak]: Memory leak: pending_msg
# 506| /* signal the thread that a new message has been posted */
# 507| pthread_cond_signal(&cond_pending_msg);
# 508|-> return 0;
# 509| }
# 510|
Error: CPPCHECK_WARNING: [#def90]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_server.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def91]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_server.c:323:14: warning[deadcode.DeadStores]: Value stored to 'str_err' during its initialization is never read
# 321| __u16 err_code = 0;
# 322| const char *msg_type = "Add Mapping Request";
# 323|-> const char *str_err = "";
# 324| int ret = -EINVAL;
# 325| __u32 flags;
Error: CLANG_WARNING: [#def92]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_server.c:431:14: warning[deadcode.DeadStores]: Value stored to 'str_err' during its initialization is never read
# 429| __u16 err_code = 0;
# 430| const char *msg_type = "Add & Query Mapping Request";
# 431|-> const char *str_err = "";
# 432| int ret = -EINVAL;
# 433| __u32 flags;
Error: CLANG_WARNING: [#def93]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_server.c:750:2: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 748| copy_iwpm_sockaddr(msg_parms->address_family, NULL, &remote_mapped_addr,
# 749| &msg_parms->apipaddr[0], NULL, &msg_parms->apport);
# 750|-> ret = -EINVAL;
# 751| iwpm_port = find_iwpm_same_mapping(&local_addr, not_mapped);
# 752| if (!iwpm_port) {
Error: CLANG_WARNING: [#def94]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_server.c:825:2: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 823| print_iwpm_sockaddr(&remote_addr, "process_wire_reject: Remote address",
# 824| IWARP_PM_ALL_DBG);
# 825|-> ret = -EINVAL;
# 826| iwpm_port = find_iwpm_same_mapping(&local_addr, not_mapped);
# 827| if (!iwpm_port) {
Error: CLANG_WARNING: [#def95]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_server.c:909:14: warning[deadcode.DeadStores]: Value stored to 'str_err' during its initialization is never read
# 907| __u16 err_code = 0;
# 908| const char *msg_type = "Mapping Info Msg";
# 909|-> const char *str_err = "";
# 910| int ret = -EINVAL;
# 911| __u32 flags;
Error: CLANG_WARNING: [#def96]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_server.c:981:14: warning[deadcode.DeadStores]: Value stored to 'str_err' during its initialization is never read
# 979| __u32 map_count;
# 980| __u16 err_code = 0;
# 981|-> const char *str_err = "";
# 982| int ret = -EINVAL;
# 983|
Error: CLANG_WARNING: [#def97]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_server.c:1040:14: warning[deadcode.DeadStores]: Value stored to 'str_err' during its initialization is never read
# 1038| struct nl_msg *resp_nlmsg;
# 1039| __u16 nlmsg_type;
# 1040|-> const char *str_err = "";
# 1041| int ret;
# 1042|
Error: CLANG_WARNING: [#def98]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_server.c:1089:14: warning[deadcode.DeadStores]: Value stored to 'str_err' during its initialization is never read
# 1087| __u16 abi_version;
# 1088| __u16 err_code = 0;
# 1089|-> const char *str_err = "";
# 1090| int ret = -EINVAL;
# 1091|
Error: CLANG_WARNING: [#def99]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_server.c:1447:5: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 1445| if (pmv4_sock >= 0) {
# 1446| if (FD_ISSET(pmv4_sock, &select_fdset))
# 1447|-> ret = process_iwpm_msg(pmv4_sock);
# 1448|
# 1449| if (FD_ISSET(pmv4_client_sock, &select_fdset))
Error: CLANG_WARNING: [#def100]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_server.c:1450:5: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 1448|
# 1449| if (FD_ISSET(pmv4_client_sock, &select_fdset))
# 1450|-> ret = process_iwpm_msg(pmv4_client_sock);
# 1451| }
# 1452|
Error: CLANG_WARNING: [#def101]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_server.c:1455:5: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 1453| if (pmv6_sock >= 0) {
# 1454| if (FD_ISSET(pmv6_sock, &select_fdset))
# 1455|-> ret = process_iwpm_msg(pmv6_sock);
# 1456|
# 1457| if (FD_ISSET(pmv6_client_sock, &select_fdset))
Error: CLANG_WARNING: [#def102]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_server.c:1458:5: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 1456|
# 1457| if (FD_ISSET(pmv6_client_sock, &select_fdset))
# 1458|-> ret = process_iwpm_msg(pmv6_client_sock);
# 1459| }
# 1460|
Error: CLANG_WARNING: [#def103]
rdma-core-48.0-build/rdma-core-48.0/iwpmd/iwarp_pm_server.c:1462:4: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 1460|
# 1461| if (FD_ISSET(netlink_sock, &select_fdset))
# 1462|-> ret = process_iwpm_netlink_msg(netlink_sock);
# 1463|
# 1464| } while (1);
Error: CPPCHECK_WARNING: [#def104]
rdma-core-48.0-build/rdma-core-48.0/kernel-boot/rdma_rename.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def105]
rdma-core-48.0-build/rdma-core-48.0/libibmad/dump.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def106]
rdma-core-48.0-build/rdma-core-48.0/libibmad/dump.c:372:3: warning[deadcode.DeadStores]: Value stored to 'n' is never read
# 370|
# 371| if (speed >> 4) {
# 372|-> n += snprintf(buf + n, bufsz - n, "undefined (%d)", speed);
# 373| return;
# 374| } else if (bufsz > 3)
Error: CPPCHECK_WARNING: [#def107]
rdma-core-48.0-build/rdma-core-48.0/libibmad/gs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def108]
rdma-core-48.0-build/rdma-core-48.0/libibmad/mad.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-476): [#def109]
rdma-core-48.0-build/rdma-core-48.0/libibmad/mad.c: scope_hint: In function ‘mad_encode’
rdma-core-48.0-build/rdma-core-48.0/libibmad/mad.c:132:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘drpath’
# 130| /* word 9 */
# 131| mad_set_field(buf, 0, IB_DRSMP_DRDLID_F,
# 132|-> drpath->drdlid ? drpath->drdlid : 0xffff);
# 133| mad_set_field(buf, 0, IB_DRSMP_DRSLID_F,
# 134| drpath->drslid ? drpath->drslid : 0xffff);
Error: GCC_ANALYZER_WARNING (CWE-479): [#def110]
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibping.c:42: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibping.c: scope_hint: In function ‘report’
rdma-core-48.0-build/rdma-core-48.0/libibmad/mad.h:1702:27: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘fprintf’ from within signal handler
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibdiag_common.h:68:22: note: in expansion of macro ‘IBDEBUG’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibping.c:152:9: note: in expansion of macro ‘DEBUG’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibping.c:44: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibping.c:152:9: note: in expansion of macro ‘DEBUG’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibdiag_common.h:68:22: note: in expansion of macro ‘IBDEBUG’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibping.c:152:9: note: in expansion of macro ‘DEBUG’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibdiag_common.h:68:22: note: in expansion of macro ‘IBDEBUG’
rdma-core-48.0-build/rdma-core-48.0/infiniband-diags/ibping.c:152:9: note: in expansion of macro ‘DEBUG’
# 1700| (int)getpid(), __func__, ## __VA_ARGS__)
# 1701|
# 1702|-> #define IBDEBUG(fmt, ...) fprintf(stdout, "ibdebug: [%d] %s: " fmt "\n", \
# 1703| (int)getpid(), __func__, ## __VA_ARGS__)
# 1704|
Error: CPPCHECK_WARNING: [#def111]
rdma-core-48.0-build/rdma-core-48.0/libibmad/register.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def112]
rdma-core-48.0-build/rdma-core-48.0/libibmad/resolve.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def113]
rdma-core-48.0-build/rdma-core-48.0/libibmad/rpc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def114]
rdma-core-48.0-build/rdma-core-48.0/libibmad/rpc.c:223:3: warning[deadcode.DeadStores]: Value stored to 'len' is never read
# 221| rpcv1->error = 0;
# 222| do {
# 223|-> len = 0;
# 224| memset(sndbuf, 0, umad_size() + IB_MAD_SIZE);
# 225|
Error: CLANG_WARNING: [#def115]
rdma-core-48.0-build/rdma-core-48.0/libibmad/rpc.c:229:8: warning[deadcode.DeadStores]: Although the value stored to 'len' is used in the enclosing expression, the value is never actually read from 'len'
# 227| return NULL;
# 228|
# 229|-> if ((len = _do_madrpc(port->port_id, sndbuf, rcvbuf,
# 230| port->class_agents[rpc->mgtclass & 0xff],
# 231| len, mad_get_timeout(port, rpc->timeout),
Error: CLANG_WARNING: [#def116]
rdma-core-48.0-build/rdma-core-48.0/libibmad/rpc.c:289:7: warning[deadcode.DeadStores]: Although the value stored to 'len' is used in the enclosing expression, the value is never actually read from 'len'
# 287| return NULL;
# 288|
# 289|-> if ((len = _do_madrpc(port->port_id, sndbuf, rcvbuf,
# 290| port->class_agents[rpc->mgtclass & 0xff],
# 291| len, mad_get_timeout(port, rpc->timeout),
Error: CPPCHECK_WARNING: [#def117]
rdma-core-48.0-build/rdma-core-48.0/libibmad/serv.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def118]
rdma-core-48.0-build/rdma-core-48.0/libibmad/serv.c:177:7: warning[deadcode.DeadStores]: Although the value stored to 'agent' is used in the enclosing expression, the value is never actually read from 'agent'
# 175| int length = IB_MAD_SIZE;
# 176|
# 177|-> if ((agent = umad_recv(srcport->port_id, mad, &length,
# 178| mad_get_timeout(srcport, timeout))) < 0) {
# 179| if (!umad)
Error: CPPCHECK_WARNING: [#def119]
rdma-core-48.0-build/rdma-core-48.0/libibmad/vendor.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def120]
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/chassis.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def121]
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/ibnetdisc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-476): [#def122]
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/ibnetdisc.c: scope_hint: In function ‘ibnd_find_node_dr’
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/ibnetdisc.c:637:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/ibnetdisc.c:52: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/ibnetdisc.c:974:17: note: in expansion of macro ‘IBND_DEBUG’
# 635| {
# 636| ibnd_port_t *rc = ibnd_find_port_dr(fabric, dr_str);
# 637|-> return rc->node;
# 638| }
# 639|
Error: CLANG_WARNING: [#def123]
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/ibnetdisc.c:646:17: warning[core.NullDereference]: Array access (from variable 'hash') results in a null pointer dereference
# 644| int hash_idx = HASHGUID(node->guid) % HTSZ;
# 645|
# 646|-> for (tblnode = hash[hash_idx]; tblnode; tblnode = tblnode->htnext) {
# 647| if (tblnode == node) {
# 648| IBND_ERROR("Duplicate Node: Node with guid 0x%016"
Error: CLANG_WARNING: [#def124]
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/ibnetdisc.c:839:2: warning[unix.Malloc]: Attempt to free released memory
# 837| ibnd_destroy_fabric(&f_int->fabric);
# 838| error_int:
# 839|-> free(f_int);
# 840| return NULL;
# 841| }
Error: CPPCHECK_WARNING: [#def125]
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/ibnetdisc_cache.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def126]
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/ibnetdisc_cache.c:248:2: warning[deadcode.DeadStores]: Value stored to 'offset' is never read
# 246|
# 247| offset += _unmarshall64(buf + offset, &fabric_cache->from_node_guid);
# 248|-> offset += _unmarshall32(buf + offset, &tmp32);
# 249| fabric_cache->f_int->fabric.maxhops_discovered = tmp32;
# 250|
Error: CLANG_WARNING: [#def127]
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/ibnetdisc_cache.c:350:2: warning[deadcode.DeadStores]: Value stored to 'offset' is never read
# 348| IB_SMP_DATA_SIZE);
# 349|
# 350|-> offset += _unmarshall8(buf + offset, &node_cache->ports_stored_count);
# 351|
# 352| if (node_cache->ports_stored_count) {
Error: CLANG_WARNING: [#def128]
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/ibnetdisc_cache.c:448:2: warning[deadcode.DeadStores]: Value stored to 'offset' is never read
# 446| offset +=
# 447| _unmarshall64(buf + offset, &port_cache->remoteport_cache_key.guid);
# 448|-> offset +=
# 449| _unmarshall8(buf + offset,
# 450| &port_cache->remoteport_cache_key.portnum);
Error: COMPILER_WARNING: [#def129]
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/ibnetdisc_cache.c: scope_hint: In function ‘_rebuild_nodes’
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/ibnetdisc_cache.c:560:36: warning[-Wcalloc-transposed-args]: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument
# 560 | calloc(sizeof(*node->ports), node->numports + 1))) {
# | ^
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/ibnetdisc_cache.c:560:36: note: earlier argument should specify number of elements, later size of each element
# 558|
# 559| if (!(node->ports =
# 560|-> calloc(sizeof(*node->ports), node->numports + 1))) {
# 561| IBND_DEBUG("OOM: node->ports\n");
# 562| return -1;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def130]
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/tests/testleaks.c: scope_hint: In function ‘main’
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/tests/testleaks.c:110:32: warning[-Wanalyzer-malloc-leak]: leak of ‘from’
# 108| break;
# 109| case 'f':
# 110|-> from = strdup(optarg);
# 111| break;
# 112| case 'C':
Error: CLANG_WARNING: [#def131]
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/tests/testleaks.c:132:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
# 130| }
# 131| }
# 132|-> argc -= optind;
# 133| argv += optind;
# 134|
Error: CLANG_WARNING: [#def132]
rdma-core-48.0-build/rdma-core-48.0/libibnetdisc/tests/testleaks.c:133:2: warning[deadcode.DeadStores]: Value stored to 'argv' is never read
# 131| }
# 132| argc -= optind;
# 133|-> argv += optind;
# 134|
# 135| while (iters == -1 || iters-- > 0) {
Error: CPPCHECK_WARNING: [#def133]
rdma-core-48.0-build/rdma-core-48.0/libibumad/tests/umad_sa_mcm_rereg_test.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def134]
rdma-core-48.0-build/rdma-core-48.0/libibumad/umad.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def135]
rdma-core-48.0-build/rdma-core-48.0/libibumad/umad.c:450:7: warning[deadcode.DeadStores]: Although the value stored to 'r' is used in the enclosing expression, the value is never actually read from 'r'
# 448| sizeof ca->hw_ver) < 0)
# 449| ca->hw_ver[0] = '\0';
# 450|-> if ((r = sys_read_string(dir_name, SYS_CA_TYPE, ca->ca_type,
# 451| sizeof ca->ca_type)) < 0)
# 452| ca->ca_type[0] = '\0';
Error: CLANG_WARNING: [#def136]
rdma-core-48.0-build/rdma-core-48.0/libibumad/umad.c:470:2: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 468| }
# 469|
# 470|-> ret = 0;
# 471| for (i = 0; i < r; i++) {
# 472| portnum = 0;
Error: CLANG_WARNING: [#def137]
rdma-core-48.0-build/rdma-core-48.0/libibumad/umad.c:1113:7: warning[deadcode.DeadStores]: Although the value stored to 'rc' is used in the enclosing expression, the value is never actually read from 'rc'
# 1111| VALGRIND_MAKE_MEM_DEFINED(&req, sizeof req);
# 1112|
# 1113|-> if ((rc = ioctl(port_fd, IB_USER_MAD_REGISTER_AGENT2, (void *)&req)) == 0) {
# 1114| DEBUG("fd %d registered to use agent %d qp %d class 0x%x oui 0x%06x",
# 1115| port_fd, req.id, req.qpn, req.mgmt_class, attr->oui);
Error: CLANG_WARNING: [#def138]
rdma-core-48.0-build/rdma-core-48.0/libibumad/umad.c:1141:9: warning[deadcode.DeadStores]: Although the value stored to 'rc' is used in the enclosing expression, the value is never actually read from 'rc'
# 1139| memcpy(req_v1.method_mask, req.method_mask, sizeof req_v1.method_mask);
# 1140|
# 1141|-> if ((rc = ioctl(port_fd, IB_USER_MAD_REGISTER_AGENT,
# 1142| (void *)&req_v1)) == 0) {
# 1143| DEBUG("fd %d registered to use agent %d qp %d class 0x%x oui 0x%06x",
Error: CLANG_WARNING: [#def139]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd.c:683:8: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'i')
# 681| i = wr;
# 682| while (--wr_count)
# 683|-> i = i->next;
# 684| *bad_wr = i;
# 685| } else if (ret)
Error: CLANG_WARNING: [#def140]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd.c:742:8: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'i')
# 740| i = wr;
# 741| while (--wr_count)
# 742|-> i = i->next;
# 743| *bad_wr = i;
# 744| } else if (ret)
Error: CLANG_WARNING: [#def141]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd.c:801:8: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'i')
# 799| i = wr;
# 800| while (--wr_count)
# 801|-> i = i->next;
# 802| *bad_wr = i;
# 803| } else if (ret)
Error: COMPILER_WARNING (CWE-126): [#def142]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_fallback.c:296:13: warning[-Wstringop-overread]: ‘write’ reading 32 bytes from a region of size 24
# 296 | if (write(ctx->cmd_fd, req, req_size) != req_size)
# | ^
rdma-core-48.0-build/rdma-core-48.0/libibverbs/kern-abi.h: scope_hint: In function ‘ibv_cmd_destroy_flow’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/kern-abi.h:216:1: note: source object ‘hdr’ of size 24
# 216 | DECLARE_CMD_EXX(IB_USER_VERBS_EX_CMD_DESTROY_FLOW, ibv_destroy_flow, ib_uverbs_destroy_flow, empty);
# | ^
/usr/include/unistd.h:378:16: note: in a call to function ‘write’ declared with attribute ‘access (read_only, 2, 3)’
# 378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
# | ^
# 294| memset(resp, 0, resp_size);
# 295|
# 296|-> if (write(ctx->cmd_fd, req, req_size) != req_size)
# 297| return errno;
# 298|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def143]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_ioctl.c: scope_hint: In function ‘execute_ioctl’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_ioctl.c:145:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_ioctl.h:43: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_ioctl.c: scope_hint: In function ‘execute_ioctl’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_ioctl.c:135:13: note: in expansion of macro ‘unlikely’
# 143| cmd->hdr.reserved1 = 0;
# 144| cmd->hdr.reserved2 = 0;
# 145|-> cmd->hdr.driver_id = vctx->priv->driver_id;
# 146|
# 147| if (ioctl(context->cmd_fd, RDMA_VERBS_IOCTL, &cmd->hdr))
Error: CLANG_WARNING: [#def144]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_qp.c:90:14: warning[core.NullDereference]: Access to field 'context' results in a dereference of a null pointer (loaded from variable 'qp')
# 88| uint32_t create_flags = 0;
# 89|
# 90|-> qp->context = context;
# 91|
# 92| switch (attr_ex->qp_type) {
Error: GCC_ANALYZER_WARNING (CWE-476): [#def145]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_qp.c: scope_hint: In function ‘ibv_icmd_create_qp’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_qp.c:90:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 88| uint32_t create_flags = 0;
# 89|
# 90|-> qp->context = context;
# 91|
# 92| switch (attr_ex->qp_type) {
Error: CLANG_WARNING: [#def146]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_srq.c:40:17: warning[core.NullDereference]: Access to field 'srq_type' results in a dereference of a null pointer (loaded from variable 'vsrq')
# 38| uint32_t srq_num)
# 39| {
# 40|-> vsrq->srq_type = (attr_ex->comp_mask & IBV_SRQ_INIT_ATTR_TYPE) ?
# 41| attr_ex->srq_type : IBV_SRQT_BASIC;
# 42| if (vsrq->srq_type == IBV_SRQT_XRC) {
Error: GCC_ANALYZER_WARNING (CWE-476): [#def147]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_srq.c: scope_hint: In function ‘set_vsrq’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_srq.c:40:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘vsrq’
# 38| uint32_t srq_num)
# 39| {
# 40|-> vsrq->srq_type = (attr_ex->comp_mask & IBV_SRQ_INIT_ATTR_TYPE) ?
# 41| attr_ex->srq_type : IBV_SRQT_BASIC;
# 42| if (vsrq->srq_type == IBV_SRQT_XRC) {
Error: CLANG_WARNING: [#def148]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_srq.c:66:15: warning[core.NullDereference]: Access to field 'context' results in a dereference of a null pointer (loaded from variable 'srq')
# 64| enum ibv_srq_type srq_type;
# 65|
# 66|-> srq->context = pd->context;
# 67| pthread_mutex_init(&srq->mutex, NULL);
# 68| pthread_cond_init(&srq->cond, NULL);
Error: GCC_ANALYZER_WARNING (CWE-476): [#def149]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_srq.c: scope_hint: In function ‘ibv_icmd_create_srq’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_srq.c:66:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 64| enum ibv_srq_type srq_type;
# 65|
# 66|-> srq->context = pd->context;
# 67| pthread_mutex_init(&srq->mutex, NULL);
# 68| pthread_cond_init(&srq->cond, NULL);
Error: CLANG_WARNING: [#def150]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_srq.c:168:24: warning[core.NullDereference]: Access to field 'handle' results in a dereference of a null pointer (loaded from variable 'vxrcd')
# 166| req->max_num_tags = attr_ex->tm_cap.max_num_tags;
# 167| else
# 168|-> req->xrcd_handle = vxrcd->handle;
# 169|
# 170| ret = execute_write_bufs(
Error: GCC_ANALYZER_WARNING (CWE-476): [#def151]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_srq.c:168:57: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘vxrcd’
# 166| req->max_num_tags = attr_ex->tm_cap.max_num_tags;
# 167| else
# 168|-> req->xrcd_handle = vxrcd->handle;
# 169|
# 170| ret = execute_write_bufs(
Error: CLANG_WARNING: [#def152]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/cmd_srq.c:195:3: warning[core.CallAndMessage]: 3rd function call argument is an uninitialized value
# 193| attr_ex->attr.max_sge = max_sge;
# 194| if (vsrq)
# 195|-> set_vsrq(vsrq, attr_ex, srq_num);
# 196|
# 197| return 0;
Error: CLANG_WARNING: [#def153]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/compat-1_0.c:339:37: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'w')
# 337| for (real_wr = head_wr, w = wr;
# 338| real_wr;
# 339|-> real_wr = real_wr->next, w = w->next)
# 340| if (real_wr == real_bad_wr) {
# 341| *bad_wr = w;
Error: CLANG_WARNING: [#def154]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/compat-1_0.c:420:37: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'w')
# 418| for (real_wr = head_wr, w = wr;
# 419| real_wr;
# 420|-> real_wr = real_wr->next, w = w->next)
# 421| if (real_wr == real_bad_wr) {
# 422| *bad_wr = w;
Error: CLANG_WARNING: [#def155]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/compat-1_0.c:457:37: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'w')
# 455| for (real_wr = head_wr, w = wr;
# 456| real_wr;
# 457|-> real_wr = real_wr->next, w = w->next)
# 458| if (real_wr == real_bad_wr) {
# 459| *bad_wr = w;
Error: CLANG_WARNING: [#def156]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/dynamic_driver.c:71:10: warning[deadcode.DeadStores]: Although the value stored to 'len' is used in the enclosing expression, the value is never actually read from 'len'
# 69| }
# 70|
# 71|-> while ((len = getline(&line, &buflen, conf)) != -1) {
# 72| config = line + strspn(line, "\t ");
# 73| if (config[0] == '\n' || config[0] == '#')
Error: GCC_ANALYZER_WARNING (CWE-465): [#def157]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/dynamic_driver.c: scope_hint: In function ‘read_config_file’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/dynamic_driver.c:78:50: warning[-Wanalyzer-deref-before-check]: check of ‘config’ for NULL after already dereferencing it
rdma-core-48.0-build/rdma-core-48.0/buildlib/fixup-include/sys-stat.h:4: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/libibverbs/dynamic_driver.c:41: included_from: Included from here.
# 76| field = strsep(&config, "\n\t ");
# 77|
# 78|-> if (strcmp(field, "driver") == 0 && config != NULL) {
# 79| struct ibv_driver_name *driver_name;
# 80|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def158]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/devinfo.c: scope_hint: In function ‘main’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/devinfo.c:709:38: warning[-Wanalyzer-malloc-leak]: leak of ‘ib_devname’
# 707| switch (c) {
# 708| case 'd':
# 709|-> ib_devname = strdup(optarg);
# 710| break;
# 711|
Error: CLANG_WARNING: [#def159]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/devinfo.c:746:4: warning[unix.Malloc]: Potential leak of memory pointed to by 'ib_devname'
# 744|
# 745| default:
# 746|-> usage(argv[0]);
# 747| return -1;
# 748| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def160]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/rc_pingpong.c: scope_hint: In function ‘main’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/rc_pingpong.c:372:19: warning[-Wanalyzer-malloc-leak]: leak of ‘pp_init_ctx(ib_dev, (int)size, (int)rx_depth, ib_port, use_event)’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/rc_pingpong.c:38: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/pingpong.h:36: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/rc_pingpong.c:49: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/libibverbs/verbs.h:2590:26: note: in definition of macro ‘ibv_reg_mr’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/rc_pingpong.c: scope_hint: In function ‘main’
# 370| ctx->channel = NULL;
# 371|
# 372|-> ctx->pd = ibv_alloc_pd(ctx->context);
# 373| if (!ctx->pd) {
# 374| fprintf(stderr, "Couldn't allocate PD\n");
Error: CLANG_WARNING: [#def161]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/rc_pingpong.c:723:8: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value
# 721| ++(*rcnt);
# 722| if (use_ts) {
# 723|-> if (ts->last_comp_with_ts) {
# 724| uint64_t delta;
# 725|
Error: CLANG_WARNING: [#def162]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/rc_pingpong.c:733:36: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
# 731| completion_timestamp + 1;
# 732|
# 733|-> ts->comp_recv_max_time_delta = max(ts->comp_recv_max_time_delta, delta);
# 734| ts->comp_recv_min_time_delta = min(ts->comp_recv_min_time_delta, delta);
# 735| ts->comp_recv_total_time_delta += delta;
Error: CLANG_WARNING: [#def163]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/rc_pingpong.c:991:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'ctx'
# 989| routs = pp_post_recv(ctx, ctx->rx_depth);
# 990| if (routs < ctx->rx_depth) {
# 991|-> fprintf(stderr, "Couldn't post receive (%d)\n", routs);
# 992| return 1;
# 993| }
Error: CLANG_WARNING: [#def164]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/srq_pingpong.c:909:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'rem_dest'
# 907|
# 908| if (gettimeofday(&start, NULL)) {
# 909|-> perror("gettimeofday");
# 910| return 1;
# 911| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def165]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/uc_pingpong.c: scope_hint: In function ‘main’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/uc_pingpong.c:338:19: warning[-Wanalyzer-malloc-leak]: leak of ‘pp_init_ctx(ib_dev, (int)size, (int)rx_depth, ib_port, use_event)’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/pingpong.h:36: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/uc_pingpong.c:48: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/libibverbs/verbs.h:2590:26: note: in definition of macro ‘ibv_reg_mr’
# 336| ctx->channel = NULL;
# 337|
# 338|-> ctx->pd = ibv_alloc_pd(ctx->context);
# 339| if (!ctx->pd) {
# 340| fprintf(stderr, "Couldn't allocate PD\n");
Error: CLANG_WARNING: [#def166]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/uc_pingpong.c:682:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'ctx'
# 680| routs = pp_post_recv(ctx, ctx->rx_depth);
# 681| if (routs < ctx->rx_depth) {
# 682|-> fprintf(stderr, "Couldn't post receive (%d)\n", routs);
# 683| return 1;
# 684| }
Error: CLANG_WARNING: [#def167]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/ud_pingpong.c:695:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'ctx'
# 693| routs = pp_post_recv(ctx, ctx->rx_depth);
# 694| if (routs < ctx->rx_depth) {
# 695|-> fprintf(stderr, "Couldn't post receive (%d)\n", routs);
# 696| return 1;
# 697| }
Error: CLANG_WARNING: [#def168]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/init.c:540:2: warning[unix.Malloc]: Use of memory after it is freed
# 538| struct verbs_device *vdev;
# 539|
# 540|-> list_for_each_safe(sysfs_list, sysfs_dev, tmp, entry) {
# 541| vdev = try_drivers(sysfs_dev);
# 542| if (vdev) {
Error: CLANG_WARNING: [#def169]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/init.c:580:3: warning[unix.Malloc]: Use of memory after it is freed
# 578| struct verbs_sysfs_dev *old_sysfs = NULL;
# 579|
# 580|-> list_for_each(&sysfs_list, sysfs_dev, entry) {
# 581| if (same_sysfs_dev(vdev->sysfs, sysfs_dev)) {
# 582| old_sysfs = sysfs_dev;
Error: CLANG_WARNING: [#def170]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/memory.c:363:6: warning[core.NullDereference]: Access to field 'start' results in a dereference of a null pointer (loaded from variable 'parent')
# 361| }
# 362|
# 363|-> if (parent->start < new->start)
# 364| parent->right = new;
# 365| else
Error: CLANG_WARNING: [#def171]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/memory.c:438:8: warning[core.NullDereference]: Access to field 'color' results in a dereference of a null pointer (loaded from variable 'sib')
# 436| sib = parent->right;
# 437|
# 438|-> if (sib->color == IBV_RED) {
# 439| parent->color = IBV_RED;
# 440| sib->color = IBV_BLACK;
Error: CLANG_WARNING: [#def172]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/memory.c:503:16: warning[unix.Malloc]: Use of memory after it is freed
# 501|
# 502| if (child)
# 503|-> child->color = IBV_BLACK;
# 504| }
# 505|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def173]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/memory.c: scope_hint: In function ‘get_start_node’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/memory.c:556:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 554|
# 555| node = __mm_find_start(start, end);
# 556|-> if (node->start < start)
# 557| node = split_range(node, start);
# 558| else {
Error: CLANG_WARNING: [#def174]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/memory.c:703:4: warning[deadcode.DeadStores]: Value stored to 'node' is never read
# 701| tmp = __mm_prev(node);
# 702| if (tmp && node->refcnt == tmp->refcnt)
# 703|-> node = merge_ranges(node, tmp);
# 704| }
# 705|
Error: GCC_ANALYZER_WARNING (CWE-688): [#def175]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/sysfs.c: scope_hint: In function ‘ibv_get_sysfs_path’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/sysfs.c:67:23: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘dup’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
# 65|
# 66| sysfs_path = dup = strndup(env, IBV_SYSFS_PATH_MAX);
# 67|-> len = strlen(dup);
# 68| while (len > 0 && dup[len - 1] == '/') {
# 69| --len;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def176]
rdma-core-48.0-build/rdma-core-48.0/libibverbs/verbs.h:2208:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pp_init_ctx(ib_dev, (int)size, (int)rx_depth, ib_port, use_event)’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/examples/ud_pingpong.c: scope_hint: In function ‘main’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/verbs.h:2590:26: note: in definition of macro ‘ibv_reg_mr’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/verbs.h:2400:38: note: in expansion of macro ‘verbs_get_ctx_op’
# 2206| static inline struct verbs_context *verbs_get_ctx(struct ibv_context *ctx)
# 2207| {
# 2208|-> if (ctx->abi_compat != __VERBS_ABI_IS_EXTENDED)
# 2209| return NULL;
# 2210|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def177]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/rdma_cma.h:39: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/librdmacm/cma.h:45: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/librdmacm/cma.c:52: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/libibverbs/verbs.h: scope_hint: In function ‘ibv_close_xrcd’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/verbs.h:2558:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
rdma-core-48.0-build/rdma-core-48.0/libibverbs/verbs.h: scope_hint: In function ‘ibv_close_xrcd’
# 2556| {
# 2557| struct verbs_context *vctx = verbs_get_ctx(xrcd->context);
# 2558|-> return vctx->close_xrcd(xrcd);
# 2559| }
# 2560|
Error: CLANG_WARNING: [#def178]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/acm.c:295:3: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
# 293| rai->ai_route = calloc(path_cnt, sizeof(*path_data));
# 294| if (rai->ai_route) {
# 295|-> memcpy(rai->ai_route, path_data, path_cnt * sizeof(*path_data));
# 296| rai->ai_route_len = path_cnt * sizeof(*path_data);
# 297| }
Error: GCC_ANALYZER_WARNING (CWE-688): [#def179]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/acm.c: scope_hint: In function ‘ucma_ib_save_resp’
rdma-core-48.0-build/rdma-core-48.0/librdmacm/acm.c:295:17: warning[-Wanalyzer-null-argument]: use of NULL ‘path_data’ where non-null expected
<built-in>: note: argument 2 of ‘__builtin_memcpy’ must be non-null
# 293| rai->ai_route = calloc(path_cnt, sizeof(*path_data));
# 294| if (rai->ai_route) {
# 295|-> memcpy(rai->ai_route, path_data, path_cnt * sizeof(*path_data));
# 296| rai->ai_route_len = path_cnt * sizeof(*path_data);
# 297| }
Error: CLANG_WARNING: [#def180]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/cma.c:368:4: warning[unix.Malloc]: Use of memory after it is freed
# 366| struct cma_device *c, *t;
# 367|
# 368|-> list_for_each_safe(&cma_dev_list, c, t, entry) {
# 369| if (c->dev == dev_list[i])
# 370| remove_cma_dev(c);
Error: CLANG_WARNING: [#def181]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/cma.c:551:19: warning[unix.Malloc]: Use of memory after it is freed
# 549| list_for_each_safe(&cma_dev_list, c, tmp, entry) {
# 550| for (i = 0; list[i]; i++) {
# 551|-> if (list[i] != c->verbs)
# 552| /*
# 553| * Skip devices that were added after
Error: COMPILER_WARNING: [#def182]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/examples/cmtime.c: scope_hint: In function ‘alloc_nodes’
rdma-core-48.0-build/rdma-core-48.0/librdmacm/examples/cmtime.c:358:31: warning[-Wcalloc-transposed-args]: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument
# 358 | nodes = calloc(sizeof *nodes, connections);
# | ^
rdma-core-48.0-build/rdma-core-48.0/librdmacm/examples/cmtime.c:358:31: note: earlier argument should specify number of elements, later size of each element
# 356| int ret, i;
# 357|
# 358|-> nodes = calloc(sizeof *nodes, connections);
# 359| if (!nodes)
# 360| return -ENOMEM;
Error: CLANG_WARNING: [#def183]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/examples/rdma_xserver.c:67:10: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
# 65| if (id->srq) {
# 66| ibv_get_srq_num(id->srq, &tmp_srqn);
# 67|-> srqn = htobe32(tmp_srqn);
# 68| }
# 69| return ret;
Error: CLANG_WARNING: [#def184]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/examples/riostream.c:371:17: warning[core.NullDereference]: Access to field 'ai_family' results in a dereference of an undefined pointer value (loaded from variable 'ai')
# 369|
# 370| lrs = rai ? rs_socket(rai->ai_family, SOCK_STREAM, 0) :
# 371|-> rs_socket(ai->ai_family, SOCK_STREAM, 0);
# 372| if (lrs < 0) {
# 373| ret = lrs;
Error: CLANG_WARNING: [#def185]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/examples/riostream.c:451:16: warning[core.NullDereference]: Access to field 'ai_family' results in a dereference of an undefined pointer value (loaded from variable 'ai')
# 449|
# 450| rs = rai ? rs_socket(rai->ai_family, SOCK_STREAM, 0) :
# 451|-> rs_socket(ai->ai_family, SOCK_STREAM, 0);
# 452| if (rs < 0) {
# 453| ret = rs;
Error: CLANG_WARNING: [#def186]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/examples/rping.c:290:3: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 288|
# 289| while ((ret = ibv_poll_cq(cb->cq, 1, &wc)) == 1) {
# 290|-> ret = 0;
# 291|
# 292| if (wc.status) {
Error: CLANG_WARNING: [#def187]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/examples/rping.c:807:3: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 805|
# 806| /* Wait for completion */
# 807|-> ret = sem_wait(&cb->sem);
# 808| if (cb->state != RDMA_WRITE_COMPLETE) {
# 809| fprintf(stderr, "wait for RDMA_WRITE_COMPLETE state %d\n",
Error: CLANG_WARNING: [#def188]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/examples/rstream.c:335:17: warning[core.NullDereference]: Access to field 'ai_family' results in a dereference of an undefined pointer value (loaded from variable 'ai')
# 333|
# 334| lrs = rai ? rs_socket(rai->ai_family, SOCK_STREAM, 0) :
# 335|-> rs_socket(ai->ai_family, SOCK_STREAM, 0);
# 336| if (lrs < 0) {
# 337| ret = lrs;
Error: CLANG_WARNING: [#def189]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/examples/rstream.c:433:16: warning[core.NullDereference]: Access to field 'ai_family' results in a dereference of a null pointer (loaded from variable 'ai')
# 431|
# 432| rs = rai ? rs_socket(rai->ai_family, SOCK_STREAM, 0) :
# 433|-> rs_socket(ai->ai_family, SOCK_STREAM, 0);
# 434| if (rs < 0) {
# 435| ret = rs;
Error: CLANG_WARNING: [#def190]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/examples/rstream.c:442:27: warning[core.NullDereference]: Access to field 'ai_src_addr' results in a dereference of a null pointer (loaded from variable 'rai_src')
# 440|
# 441| if (src_addr) {
# 442|-> ret = rai ? rs_bind(rs, rai_src->ai_src_addr, rai_src->ai_src_len) :
# 443| rs_bind(rs, ai_src->ai_addr, ai_src->ai_addrlen);
# 444| if (ret) {
Error: CLANG_WARNING: [#def191]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/examples/rstream.c:443:20: warning[core.NullDereference]: Access to field 'ai_addr' results in a dereference of a null pointer (loaded from variable 'ai_src')
# 441| if (src_addr) {
# 442| ret = rai ? rs_bind(rs, rai_src->ai_src_addr, rai_src->ai_src_len) :
# 443|-> rs_bind(rs, ai_src->ai_addr, ai_src->ai_addrlen);
# 444| if (ret) {
# 445| perror("rbind");
Error: GCC_ANALYZER_WARNING (CWE-131): [#def192]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/rsocket.c: scope_hint: In function ‘rs_svc_grow_sets’
rdma-core-48.0-build/rdma-core-48.0/librdmacm/rsocket.c:4228:18: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
# 4226|
# 4227| free(svc->rss);
# 4228|-> svc->rss = rss;
# 4229| svc->contexts = contexts;
# 4230| return 0;
Error: GCC_ANALYZER_WARNING (CWE-457): [#def193]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/rsocket.c: scope_hint: In function ‘udp_svc_forward’
rdma-core-48.0-build/rdma-core-48.0/librdmacm/rsocket.c:4413:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘&hdr’
# 4411|
# 4412| ds_format_hdr(&hdr, src);
# 4413|-> memcpy((void *) msg, &hdr, hdr.length);
# 4414| memcpy((void *) msg + hdr.length, buf, len);
# 4415| sge.addr = (uintptr_t) msg;
Error: GCC_ANALYZER_WARNING (CWE-457): [#def194]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/rsocket.c: scope_hint: In function ‘udp_svc_process_rs’
rdma-core-48.0-build/rdma-core-48.0/librdmacm/rsocket.c:4454:31: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘dest’
rdma-core-48.0-build/rdma-core-48.0/librdmacm/rsocket.c:60: included_from: Included from here.
# 4452| fastlock_acquire(&rs->slock);
# 4453| cur_dest = rs->conn_dest;
# 4454|-> rs->conn_dest = dest;
# 4455| ds_send_udp(rs, NULL, 0, 0, RS_OP_CTRL);
# 4456| rs->conn_dest = cur_dest;
Error: GCC_ANALYZER_WARNING (CWE-457): [#def195]
rdma-core-48.0-build/rdma-core-48.0/librdmacm/rsocket.c:4460:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘dest’
# 4458| }
# 4459|
# 4460|-> if (!dest->ah || (dest->qpn != qpn))
# 4461| udp_svc_create_ah(rs, dest, qpn);
# 4462|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def196]
rdma-core-48.0-build/rdma-core-48.0/providers/bnxt_re/main.c: scope_hint: In function ‘bnxt_re_device_alloc’
rdma-core-48.0-build/rdma-core-48.0/providers/bnxt_re/main.c:292:16: warning[-Wanalyzer-malloc-leak]: leak of ‘rdev’
# 290| return NULL;
# 291|
# 292|-> return &rdev->vdev;
# 293| }
# 294|
Error: CLANG_WARNING: [#def197]
rdma-core-48.0-build/rdma-core-48.0/providers/bnxt_re/verbs.c:1019:8: warning[unix.Malloc]: Use of memory after it is freed
# 1017| }
# 1018| if (qp->jsqq) {
# 1019|-> free(qp->jsqq->hwque);
# 1020| free(qp->jsqq);
# 1021| }
Error: GCC_ANALYZER_WARNING (CWE-416): [#def198]
rdma-core-48.0-build/rdma-core-48.0/providers/bnxt_re/verbs.c:1019:30: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘*qp.jsqq’
# 1017| }
# 1018| if (qp->jsqq) {
# 1019|-> free(qp->jsqq->hwque);
# 1020| free(qp->jsqq);
# 1021| }
Error: GCC_ANALYZER_WARNING (CWE-457): [#def199]
rdma-core-48.0-build/rdma-core-48.0/providers/bnxt_re/verbs.c: scope_hint: In function ‘bnxt_re_free_queue_ptr’
rdma-core-48.0-build/rdma-core-48.0/providers/bnxt_re/verbs.c:1019:30: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*qp_10(D)->jsqq.hwque’
# 1017| }
# 1018| if (qp->jsqq) {
# 1019|-> free(qp->jsqq->hwque);
# 1020| free(qp->jsqq);
# 1021| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def200]
rdma-core-48.0-build/rdma-core-48.0/providers/bnxt_re/verbs.c: scope_hint: In function ‘bnxt_re_alloc_queue_ptr’
rdma-core-48.0-build/rdma-core-48.0/providers/bnxt_re/verbs.c:1039:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 1037| qp->jrqq = calloc(1, sizeof(struct bnxt_re_joint_queue));
# 1038| if (!qp->jrqq) {
# 1039|-> free(qp->jsqq);
# 1040| goto fail;
# 1041| }
Error: GCC_ANALYZER_WARNING (CWE-476): [#def201]
rdma-core-48.0-build/rdma-core-48.0/providers/bnxt_re/verbs.c: scope_hint: In function ‘bnxt_re_srq_free_queue_ptr’
rdma-core-48.0-build/rdma-core-48.0/providers/bnxt_re/verbs.c:1839:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘srq’
# 1837| static void bnxt_re_srq_free_queue_ptr(struct bnxt_re_srq *srq)
# 1838| {
# 1839|-> free(srq->srqq);
# 1840| free(srq);
# 1841| }
Error: GCC_ANALYZER_WARNING (CWE-122): [#def202]
rdma-core-48.0-build/rdma-core-48.0/providers/bnxt_re/verbs.c: scope_hint: In function ‘bnxt_re_srq_alloc_queue’
rdma-core-48.0-build/rdma-core-48.0/providers/bnxt_re/verbs.c:1893:45: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
# 1891| for (idx = 0; idx < que->depth; idx++)
# 1892| srq->srwrid[idx].next_idx = idx + 1;
# 1893|-> srq->srwrid[srq->last_idx].next_idx = -1;
# 1894|
# 1895| /*TODO: update actual max depth. */
Error: GCC_ANALYZER_WARNING (CWE-457): [#def203]
rdma-core-48.0-build/rdma-core-48.0/providers/cxgb4/cq.c: scope_hint: In function ‘insert_recv_cqe’
rdma-core-48.0-build/rdma-core-48.0/providers/cxgb4/cq.c:59:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘&cqe’
/usr/include/sys/types.h:176: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/libibverbs/verbs.h:46: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/libibverbs/driver.h:40: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/providers/cxgb4/libcxgb4.h:42: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/providers/cxgb4/cq.c:40: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/providers/cxgb4/cq.c: scope_hint: In function ‘insert_recv_cqe’
# 57| cqe.b64.u.srcqe.abs_rqe_idx = htobe32(srqidx);
# 58|
# 59|-> memcpy(Q_ENTRY(cq->sw_queue, cq->sw_pidx), &cqe, CQE_SIZE(&cqe));
# 60| t4_swcq_produce(cq);
# 61| }
Error: CLANG_WARNING: [#def204]
rdma-core-48.0-build/rdma-core-48.0/providers/cxgb4/cq.c:216:6: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
# 214| PDBG("%s cqid 0x%x\n", __func__, chp->cq.cqid);
# 215| ret = t4_next_hw_cqe(&chp->cq, &hw_cqe);
# 216|-> com = &hw_cqe->com;
# 217|
# 218| /*
Error: CLANG_WARNING: [#def205]
rdma-core-48.0-build/rdma-core-48.0/providers/cxgb4/cq.c:745:15: warning[core.NullDereference]: Dereference of null pointer
# 743| INC_STAT(cqe);
# 744| wc->wr_id = cookie;
# 745|-> wc->qp_num = qhp->wq.sq.qid;
# 746| wc->vendor_err = CQE_STATUS(com);
# 747| wc->wc_flags = 0;
Error: CLANG_WARNING: [#def206]
rdma-core-48.0-build/rdma-core-48.0/providers/cxgb4/qp.c:129:3: warning[deadcode.DeadStores]: Value stored to 'srcp' is never read
# 127| memcpy(dstp, srcp, len);
# 128| dstp += len;
# 129|-> srcp += len;
# 130| }
# 131| len = ROUND_UP(plen + 8, 16) - (plen + 8);
Error: CLANG_WARNING: [#def207]
rdma-core-48.0-build/rdma-core-48.0/providers/cxgb4/qp.c:604:3: warning[core.CallAndMessage]: 4th function call argument is an uninitialized value
# 602| }
# 603| if (t4_wq_db_enabled(&qhp->wq)) {
# 604|-> t4_ring_sq_db(&qhp->wq, idx, dev_is_t4(qhp->rhp),
# 605| len16, wqe);
# 606| } else
Error: GCC_ANALYZER_WARNING (CWE-457): [#def208]
rdma-core-48.0-build/rdma-core-48.0/providers/cxgb4/qp.c: scope_hint: In function ‘c4iw_post_send’
rdma-core-48.0-build/rdma-core-48.0/providers/cxgb4/qp.c:604:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘len16’
rdma-core-48.0-build/rdma-core-48.0/providers/cxgb4/qp.c:39: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/util/compiler.h:18:30: note: in definition of macro ‘uninitialized_var’
rdma-core-48.0-build/rdma-core-48.0/util/compiler.h:18:30: note: in definition of macro ‘uninitialized_var’
rdma-core-48.0-build/rdma-core-48.0/providers/cxgb4/qp.c: scope_hint: In function ‘c4iw_post_send’
rdma-core-48.0-build/rdma-core-48.0/providers/cxgb4/qp.c: scope_hint: In function ‘c4iw_post_send’
rdma-core-48.0-build/rdma-core-48.0/providers/cxgb4/qp.c: scope_hint: In function ‘c4iw_post_send’
# 602| }
# 603| if (t4_wq_db_enabled(&qhp->wq)) {
# 604|-> t4_ring_sq_db(&qhp->wq, idx, dev_is_t4(qhp->rhp),
# 605| len16, wqe);
# 606| } else
Error: CLANG_WARNING: [#def209]
rdma-core-48.0-build/rdma-core-48.0/providers/cxgb4/qp.c:759:3: warning[core.CallAndMessage]: 5th function call argument is an uninitialized value
# 757| }
# 758| if (t4_wq_db_enabled(&qhp->wq))
# 759|-> t4_ring_rq_db(&qhp->wq, idx, dev_is_t4(qhp->rhp),
# 760| len16, wqe);
# 761| else
Error: GCC_ANALYZER_WARNING (CWE-401): [#def210]
rdma-core-48.0-build/rdma-core-48.0/providers/efa/efa.c: scope_hint: In function ‘efa_device_alloc’
rdma-core-48.0-build/rdma-core-48.0/providers/efa/efa.c:127:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
# 125| dev->pg_sz = sysconf(_SC_PAGESIZE);
# 126|
# 127|-> return &dev->vdev;
# 128| }
# 129|
Error: CLANG_WARNING: [#def211]
rdma-core-48.0-build/rdma-core-48.0/providers/efa/verbs.c:1273:6: warning[core.NullDereference]: Access to field 'driver_qp_type' results in a dereference of a null pointer (loaded from variable 'efa_attr')
# 1271|
# 1272| if (attr->qp_type == IBV_QPT_DRIVER &&
# 1273|-> efa_attr->driver_qp_type != EFADV_QP_DRIVER_TYPE_SRD) {
# 1274| verbs_err(&ctx->ibvctx, "Driver QP type must be SRD\n");
# 1275| return EOPNOTSUPP;
Error: GCC_ANALYZER_WARNING (CWE-476): [#def212]
rdma-core-48.0-build/rdma-core-48.0/providers/efa/verbs.c: scope_hint: In function ‘efa_check_qp_attr’
rdma-core-48.0-build/rdma-core-48.0/providers/efa/verbs.c:1273:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘efa_attr’
# 1271|
# 1272| if (attr->qp_type == IBV_QPT_DRIVER &&
# 1273|-> efa_attr->driver_qp_type != EFADV_QP_DRIVER_TYPE_SRD) {
# 1274| verbs_err(&ctx->ibvctx, "Driver QP type must be SRD\n");
# 1275| return EOPNOTSUPP;
Error: CLANG_WARNING: [#def213]
rdma-core-48.0-build/rdma-core-48.0/providers/efa/verbs.c:1398:24: warning[core.NullDereference]: Access to field 'driver_qp_type' results in a dereference of a null pointer (loaded from variable 'efa_attr')
# 1396| sizeof(struct efa_io_tx_wqe);
# 1397| if (attr->qp_type == IBV_QPT_DRIVER)
# 1398|-> req.driver_qp_type = efa_attr->driver_qp_type;
# 1399|
# 1400| err = ibv_cmd_create_qp_ex(ibvctx, &qp->verbs_qp,
Error: GCC_ANALYZER_WARNING (CWE-401): [#def214]
rdma-core-48.0-build/rdma-core-48.0/providers/erdma/erdma.c: scope_hint: In function ‘erdma_device_alloc’
rdma-core-48.0-build/rdma-core-48.0/providers/erdma/erdma.c:109:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
# 107| return NULL;
# 108|
# 109|-> return &dev->ibv_dev;
# 110| }
# 111|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def215]
rdma-core-48.0-build/rdma-core-48.0/providers/hfi1verbs/hfiverbs.c: scope_hint: In function ‘hfi1_device_alloc’
rdma-core-48.0-build/rdma-core-48.0/providers/hfi1verbs/hfiverbs.c:200:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
# 198| dev->abi_version = sysfs_dev->abi_ver;
# 199|
# 200|-> return &dev->ibv_dev;
# 201| }
# 202|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def216]
rdma-core-48.0-build/rdma-core-48.0/providers/hns/hns_roce_u.c: scope_hint: In function ‘hns_device_alloc’
rdma-core-48.0-build/rdma-core-48.0/providers/hns/hns_roce_u.c:207:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
# 205| dev->hw_version = dev->u_hw->hw_version;
# 206| dev->page_size = sysconf(_SC_PAGESIZE);
# 207|-> return &dev->ibv_dev;
# 208| }
# 209|
Error: CLANG_WARNING: [#def217]
rdma-core-48.0-build/rdma-core-48.0/providers/hns/hns_roce_u_hw_v2.c:1720:2: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage
# 1718| static void update_srq_db(struct hns_roce_db *db, struct hns_roce_srq *srq)
# 1719| {
# 1720|-> hr_reg_write(db, DB_TAG, srq->srqn);
# 1721| hr_reg_write(db, DB_CMD, HNS_ROCE_V2_SRQ_DB);
# 1722| hr_reg_write(db, DB_PI, srq->idx_que.head);
Error: CLANG_WARNING: [#def218]
rdma-core-48.0-build/rdma-core-48.0/providers/hns/hns_roce_u_verbs.c:909:7: warning[unix.Malloc]: Use of memory after it is freed
# 907| {
# 908| if (rinl_buf->wqe_list) {
# 909|-> if (rinl_buf->wqe_list[0].sg_list) {
# 910| free(rinl_buf->wqe_list[0].sg_list);
# 911| rinl_buf->wqe_list[0].sg_list = NULL;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def219]
rdma-core-48.0-build/rdma-core-48.0/providers/ipathverbs/ipathverbs.c: scope_hint: In function ‘ipath_device_alloc’
rdma-core-48.0-build/rdma-core-48.0/providers/ipathverbs/ipathverbs.c:198:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
# 196| dev->abi_version = sysfs_dev->abi_ver;
# 197|
# 198|-> return &dev->ibv_dev;
# 199| }
# 200|
Error: CLANG_WARNING: [#def220]
rdma-core-48.0-build/rdma-core-48.0/providers/irdma/uk.c:6: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/providers/irdma/defs.h:309:29: warning[core.NullDereference]: Array access (from variable 'wqe_words') results in a null pointer dereference
# 307| static inline void set_32bit_val(__le32 *wqe_words, __u32 byte_index, __u32 val)
# 308| {
# 309|-> wqe_words[byte_index >> 2] = htole32(val);
# 310| }
# 311|
Error: CPPCHECK_WARNING: [#def221]
rdma-core-48.0-build/rdma-core-48.0/providers/irdma/uk.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-401): [#def222]
rdma-core-48.0-build/rdma-core-48.0/providers/irdma/umain.c: scope_hint: In function ‘irdma_device_alloc’
rdma-core-48.0-build/rdma-core-48.0/providers/irdma/umain.c:234:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
# 232| return NULL;
# 233|
# 234|-> return &dev->ibv_dev;
# 235| }
# 236|
Error: CLANG_WARNING: [#def223]
rdma-core-48.0-build/rdma-core-48.0/providers/irdma/uverbs.c:458:2: warning[unix.Malloc]: Use of memory after it is freed
# 456| }
# 457| err_dereg_mr:
# 458|-> irdma_free_hw_buf(info.cq_base, total_size);
# 459| err_cq_base:
# 460| pthread_spin_destroy(&iwucq->lock);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def224]
rdma-core-48.0-build/rdma-core-48.0/providers/mana/mana.c: scope_hint: In function ‘mana_alloc_parent_domain’
rdma-core-48.0-build/rdma-core-48.0/providers/mana/mana.c:124:16: warning[-Wanalyzer-malloc-leak]: leak of ‘mparent_domain’
rdma-core-48.0-build/rdma-core-48.0/providers/mana/mana.c: scope_hint: In function ‘mana_alloc_parent_domain’
# 122| mparent_domain->pd_context = attr->pd_context;
# 123|
# 124|-> return &mparent_domain->mpd.ibv_pd;
# 125| }
# 126|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def225]
rdma-core-48.0-build/rdma-core-48.0/providers/mana/mana.c: scope_hint: In function ‘mana_device_alloc’
rdma-core-48.0-build/rdma-core-48.0/providers/mana/mana.c:354:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
# 352| return NULL;
# 353|
# 354|-> return &dev->verbs_dev;
# 355| }
# 356|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def226]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx4/mlx4.c: scope_hint: In function ‘mlx4_device_alloc’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx4/mlx4.c:265:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
# 263| dev->abi_version = sysfs_dev->abi_ver;
# 264|
# 265|-> return &dev->verbs_dev;
# 266| }
# 267|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def227]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dbrec.c: scope_hint: In function ‘mlx5_alloc_dbrec’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dbrec.c:97:36: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 95| struct mlx5_parent_domain *mparent_domain = to_mparent_domain(pd);
# 96|
# 97|-> db = mparent_domain->alloc(&mparent_domain->mpd.ibv_pd,
# 98| mparent_domain->pd_context, 8, 8,
# 99| MLX5DV_RES_TYPE_DBR);
Error: GCC_ANALYZER_WARNING (CWE-476): [#def228]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dbrec.c: scope_hint: In function ‘mlx5_free_db’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dbrec.c:153:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 151| struct mlx5_parent_domain *mparent_domain = to_mparent_domain(pd);
# 152|
# 153|-> mparent_domain->free(&mparent_domain->mpd.ibv_pd,
# 154| mparent_domain->pd_context,
# 155| db,
Error: CLANG_WARNING: [#def229]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_arg.c:40:2: warning[deadcode.DeadStores]: Value stored to 'object_range' is never read
# 38| int i;
# 39|
# 40|-> object_range =
# 41| pool->dmn->info.caps.log_header_modify_argument_granularity;
# 42|
Error: CLANG_WARNING: [#def230]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_arg.c:71:13: warning[unix.MallocSizeof]: Result of 'calloc' is converted to a pointer of type 'struct dr_arg_obj', which is incompatible with sizeof operand type 'struct dr_arg_pool'
# 69|
# 70| for (i = 0; i < num_of_objects; i++) {
# 71|-> arg_obj = calloc(1, sizeof(struct dr_arg_pool));
# 72| if (!arg_obj) {
# 73| errno = ENOMEM;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def231]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_arg.c: scope_hint: In function ‘dr_arg_pool_alloc_objs’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_arg.c:71:27: warning[-Wanalyzer-malloc-leak]: leak of ‘arg_obj’
# 69|
# 70| for (i = 0; i < num_of_objects; i++) {
# 71|-> arg_obj = calloc(1, sizeof(struct dr_arg_pool));
# 72| if (!arg_obj) {
# 73| errno = ENOMEM;
Error: CLANG_WARNING: [#def232]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_buddy.c:66:16: warning[unix.MallocSizeof]: Result of 'calloc' is converted to a pointer of type 'unsigned long *', which is incompatible with sizeof operand type 'long *'
# 64| list_head_init(&buddy->hot_list);
# 65|
# 66|-> buddy->bits = calloc(buddy->max_order + 1, sizeof(long *));
# 67| if (!buddy->bits) {
# 68| errno = ENOMEM;
Error: CLANG_WARNING: [#def233]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_buddy.c:76:19: warning[unix.MallocSizeof]: Result of 'calloc' is converted to a pointer of type 'unsigned long *', which is incompatible with sizeof operand type 'long *'
# 74| goto err_out_free_bits;
# 75|
# 76|-> buddy->set_bit = calloc(buddy->max_order + 1, sizeof(long *));
# 77| if (!buddy->set_bit)
# 78| goto err_out_free_num_free;
Error: CLANG_WARNING: [#def234]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_dbg.c:414:3: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 412| if (criteria & DR_MATCHER_CRITERIA_MISC3) {
# 413| dump_hex_print(dump, (char *)&mask->misc3, sizeof(mask->misc3));
# 414|-> ret = fprintf(f, "%s,", dump);
# 415| } else {
# 416| ret = fprintf(f, ",");
Error: CLANG_WARNING: [#def235]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_dbg.c:416:3: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 414| ret = fprintf(f, "%s,", dump);
# 415| } else {
# 416|-> ret = fprintf(f, ",");
# 417| }
# 418|
Error: CLANG_WARNING: [#def236]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_dbg.c:421:3: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 419| if (criteria & DR_MATCHER_CRITERIA_MISC4) {
# 420| dump_hex_print(dump, (char *)&mask->misc4, sizeof(mask->misc4));
# 421|-> ret = fprintf(f, "%s,", dump);
# 422| } else {
# 423| ret = fprintf(f, ",");
Error: CLANG_WARNING: [#def237]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_dbg.c:423:3: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 421| ret = fprintf(f, "%s,", dump);
# 422| } else {
# 423|-> ret = fprintf(f, ",");
# 424| }
# 425|
Error: CLANG_WARNING: [#def238]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_matcher.c:704:3: warning[deadcode.DeadStores]: Value stored to 'idx' is never read
# 702|
# 703| memset(sb, 0, sizeof(*sb));
# 704|-> idx = 0;
# 705| }
# 706|
Error: CLANG_WARNING: [#def239]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_matcher.c:1003:4: warning[core.CallAndMessage]: 4th function call argument is an uninitialized value
# 1001| if (matcher->match_criteria & DR_MATCHER_CRITERIA_MISC) {
# 1002| if (dr_mask_is_ib_l4_set(&mask.misc))
# 1003|-> dr_ste_build_ib_l4(ste_ctx, &sb[idx++], &mask,
# 1004| inner, rx);
# 1005| }
Error: CLANG_WARNING: [#def240]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_matcher.c:1322:4: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
# 1320| dr_dbg(dmn, "Match param mask contains unsupported parameters\n");
# 1321| errno = EOPNOTSUPP;
# 1322|-> ret = errno;
# 1323| }
# 1324|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def241]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c: scope_hint: In function ‘dr_rule_append_to_miss_list’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c:58:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c: scope_hint: In function ‘dr_rule_append_to_miss_list’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c: scope_hint: In function ‘dr_rule_append_to_miss_list’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:5: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/mlx5dv_dr.h:36: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c: scope_hint: In function ‘dr_rule_append_to_miss_list’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:768:9: note: in expansion of macro ‘list_for_each_safe_off_dir_’
rdma-core-48.0-build/rdma-core-48.0/ccan/list.h:582:9: note: in expansion of macro ‘list_for_each_safe_off’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c:341:9: note: in expansion of macro ‘list_for_each_safe’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c:49:20: note: in expansion of macro ‘list_tail’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c: scope_hint: In function ‘dr_rule_append_to_miss_list’
# 56| }
# 57|
# 58|-> dr_ste_set_miss_addr(ste_ctx,
# 59| last_ste->hw_ste,
# 60| dr_ste_get_icm_addr(new_last_ste));
Error: CLANG_WARNING: [#def242]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c:791:24: warning[core.NullDereference]: Access to field 'next_htbl' results in a dereference of a null pointer (loaded from variable 'last_ste')
# 789|
# 790| action_ste->htbl->pointing_ste = last_ste;
# 791|-> last_ste->next_htbl = action_ste->htbl;
# 792| last_ste = action_ste;
# 793|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def243]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c: scope_hint: In function ‘dr_rule_handle_cross_action_stes’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c:791:45: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘last_ste’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c: scope_hint: In function ‘dr_rule_handle_cross_action_stes’
# 789|
# 790| action_ste->htbl->pointing_ste = last_ste;
# 791|-> last_ste->next_htbl = action_ste->htbl;
# 792| last_ste = action_ste;
# 793|
Error: CLANG_WARNING: [#def244]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c:811:24: warning[core.NullDereference]: Access to field 'next_htbl' results in a dereference of a null pointer (loaded from variable 'last_ste')
# 809| /* Connect last ste to cross_dmn_action_ste */
# 810| cross_dmn_action_ste->htbl->pointing_ste = last_ste;
# 811|-> last_ste->next_htbl = cross_dmn_action_ste->htbl;
# 812| dr_ste_set_hit_addr_by_next_htbl(dmn->ste_ctx,
# 813| prev_hw_ste,
Error: GCC_ANALYZER_WARNING (CWE-476): [#def245]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c:811:45: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘last_ste’
# 809| /* Connect last ste to cross_dmn_action_ste */
# 810| cross_dmn_action_ste->htbl->pointing_ste = last_ste;
# 811|-> last_ste->next_htbl = cross_dmn_action_ste->htbl;
# 812| dr_ste_set_hit_addr_by_next_htbl(dmn->ste_ctx,
# 813| prev_hw_ste,
Error: GCC_ANALYZER_WARNING (CWE-457): [#def246]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c:837:50: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cross_dmn_rule_ste’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c: scope_hint: In function ‘dr_rule_handle_cross_action_stes’
# 835| send_ste_list, false);
# 836| } else {
# 837|-> memcpy(cross_dmn_rule_ste->hw_ste,
# 838| curr_hw_ste,
# 839| DR_STE_SIZE_REDUCED);
Error: CLANG_WARNING: [#def247]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c:848:22: warning[core.NullDereference]: Access to field 'next_htbl' results in a dereference of a null pointer (loaded from variable 'last_ste')
# 846| }
# 847|
# 848|-> last_ste->next_htbl = NULL;
# 849|
# 850| return 0;
Error: GCC_ANALYZER_WARNING (CWE-476): [#def248]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c:848:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘last_ste’
# 846| }
# 847|
# 848|-> last_ste->next_htbl = NULL;
# 849|
# 850| return 0;
Error: CLANG_WARNING: [#def249]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c:900:23: warning[core.NullDereference]: Access to field 'next_htbl' results in a dereference of a null pointer (loaded from variable 'last_ste')
# 898| */
# 899| if (num_of_builders == new_hw_ste_arr_sz) {
# 900|-> last_ste->next_htbl = NULL;
# 901| return 0;
# 902| }
Error: GCC_ANALYZER_WARNING (CWE-476): [#def250]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c: scope_hint: In function ‘dr_rule_handle_regular_action_stes’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c:900:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘last_ste’
# 898| */
# 899| if (num_of_builders == new_hw_ste_arr_sz) {
# 900|-> last_ste->next_htbl = NULL;
# 901| return 0;
# 902| }
Error: CLANG_WARNING: [#def251]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c:916:23: warning[core.NullDereference]: Access to field 'next_htbl' results in a dereference of a null pointer (loaded from variable 'last_ste')
# 914|
# 915| action_ste->htbl->pointing_ste = last_ste;
# 916|-> last_ste->next_htbl = action_ste->htbl;
# 917| last_ste = action_ste;
# 918|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def252]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c:916:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘last_ste’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_rule.c: scope_hint: In function ‘dr_rule_handle_regular_action_stes’
# 914|
# 915| action_ste->htbl->pointing_ste = last_ste;
# 916|-> last_ste->next_htbl = action_ste->htbl;
# 917| last_ste = action_ste;
# 918|
Error: CLANG_WARNING: [#def253]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_send.c:463:2: warning[deadcode.DeadStores]: Value stored to 'wqe' is never read
# 461| }
# 462| memcpy(wqe, addr, len);
# 463|-> wqe += len;
# 464|
# 465| if (likely(inl)) {
Error: GCC_ANALYZER_WARNING (CWE-476): [#def254]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_ste.c: scope_hint: In function ‘dr_ste_remove_middle_ste’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_ste.c:345:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/mlx5dv_dr.h:36: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_ste.c:33: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_ste.c:341:20: note: in expansion of macro ‘list_prev’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_ste.c: scope_hint: In function ‘dr_ste_remove_middle_ste’
# 343|
# 344| miss_addr = ste_ctx->get_miss_addr(ste->hw_ste);
# 345|-> ste_ctx->set_miss_addr(prev_ste->hw_ste, miss_addr);
# 346|
# 347| dr_send_fill_and_append_ste_send_info(prev_ste, DR_STE_SIZE_CTRL, 0,
Error: GCC_ANALYZER_WARNING (CWE-476): [#def255]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_ste.c: scope_hint: In function ‘dr_ste_free’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_ste.c:373:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_ste.c:185:24: note: in expansion of macro ‘list_top’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_ste.c: scope_hint: In function ‘dr_ste_free’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_ste.c:185:24: note: in expansion of macro ‘list_top’
# 371|
# 372| first_ste = dr_ste_get_miss_list_top(ste);
# 373|-> stats_tbl = first_ste->htbl;
# 374| /*
# 375| * Two options:
Error: GCC_ANALYZER_WARNING (CWE-476): [#def256]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_ste_v1.c: scope_hint: In function ‘dr_ste_v1_aso_other_domain_link’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_ste_v1.c:3454:39: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cross_dmn_arrays’
# 3452| cross_dmn_arrays = (struct dr_aso_cross_dmn_arrays *) malloc(sizeof(struct dr_aso_cross_dmn_arrays));
# 3453|
# 3454|-> cross_dmn_arrays->action_htbl = action_htbl;
# 3455| cross_dmn_arrays->rule_htbl = rule_htbl;
# 3456| devx_obj->priv = cross_dmn_arrays;
Error: CLANG_WARNING: [#def257]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_vports.c:247:15: warning[core.NullDereference]: Access to field 'next' results in a dereference of an undefined pointer value (loaded from variable 'prev')
# 245| while (vport) {
# 246| if (vport == wire) {
# 247|-> prev->next = vport->next;
# 248| break;
# 249| }
Error: COMPILER_WARNING (CWE-457): [#def258]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_vports.c: scope_hint: In function ‘dr_vports_table_del_wire’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_vports.c:247:36: warning[-Wmaybe-uninitialized]: ‘prev’ may be used uninitialized
# 247 | prev->next = vport->next;
# | ~~~~~~~~~~~^~~~~~~~~~~~~
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/dr_vports.c:231:43: note: ‘prev’ was declared here
# 231 | struct dr_devx_vport_cap *vport, *prev;
# | ^~~~
# 245| while (vport) {
# 246| if (vport == wire) {
# 247|-> prev->next = vport->next;
# 248| break;
# 249| }
Error: GCC_ANALYZER_WARNING (CWE-401): [#def259]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/mlx5.c: scope_hint: In function ‘mlx5_device_alloc’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/mlx5.c:2718:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
# 2716|
# 2717| mlx5_set_dv_ctx_ops(&mlx5_dv_ctx_ops);
# 2718|-> return &dev->verbs_dev;
# 2719| }
# 2720|
Error: CLANG_WARNING: [#def260]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/mlx5_vfio.c:1095:2: warning[unix.Malloc]: Potential leak of memory pointed to by 'info'
# 1093|
# 1094| end:
# 1095|-> free(info);
# 1096| return ret;
# 1097| }
Error: CLANG_WARNING: [#def261]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/mlx5_vfio.c:2416:12: warning[core.BitwiseShift]: Right shift by '64' overflows the capacity of 'unsigned long'
# 2414| */
# 2415| mr->iova_aligned_offset =
# 2416|-> hca_va & GENMASK(page_shift - 1, iova_min_page_shift);
# 2417| mr->iova_reg_size = align(length + hca_va, ctx->iova_min_page_size) -
# 2418| align_down(hca_va, ctx->iova_min_page_size);
Error: GCC_ANALYZER_WARNING (CWE-401): [#def262]
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/verbs.c: scope_hint: In function ‘_mlx5dv_create_mkey’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/verbs.c:6893:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
rdma-core-48.0-build/rdma-core-48.0/providers/mlx5/verbs.c:41: included_from: Included from here.
# 6891| mlx5_destroy_sig_ctx(mkey->sig);
# 6892| err_free_mkey:
# 6893|-> free(mkey);
# 6894| return NULL;
# 6895| }
Error: CLANG_WARNING: [#def263]
rdma-core-48.0-build/rdma-core-48.0/providers/mthca/ah.c:119:15: warning[deadcode.DeadStores]: Although the value stored to 'j' is used in the enclosing expression, the value is never actually read from 'j'
# 117| ++page->use_cnt;
# 118|
# 119|-> for (i = 0, j = -1; i < pp; ++i)
# 120| if (page->free[i]) {
# 121| j = ffs(page->free[i]);
Error: GCC_ANALYZER_WARNING (CWE-476): [#def264]
rdma-core-48.0-build/rdma-core-48.0/providers/mthca/memfree.c: scope_hint: In function ‘mthca_alloc_db_tab’
rdma-core-48.0-build/rdma-core-48.0/providers/mthca/memfree.c:181:28: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘db_tab’
# 179| pthread_mutex_init(&db_tab->mutex, NULL);
# 180|
# 181|-> db_tab->npages = npages;
# 182| db_tab->max_group1 = 0;
# 183| db_tab->min_group2 = npages - 1;
Error: GCC_ANALYZER_WARNING (CWE-401): [#def265]
rdma-core-48.0-build/rdma-core-48.0/providers/mthca/mthca.c: scope_hint: In function ‘mthca_device_alloc’
rdma-core-48.0-build/rdma-core-48.0/providers/mthca/mthca.c:232:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
# 230| dev->page_size = sysconf(_SC_PAGESIZE);
# 231|
# 232|-> return &dev->ibv_dev;
# 233| }
# 234|
Error: CLANG_WARNING: [#def266]
rdma-core-48.0-build/rdma-core-48.0/providers/ocrdma/ocrdma_verbs.c:858:25: warning[core.BitwiseShift]: Right operand is negative in left shift
# 856| {
# 857| int i = idx / 32;
# 858|-> unsigned int mask = (1 << (idx % 32));
# 859|
# 860| if (srq->idx_bit_fields[i] & mask) {
Error: GCC_ANALYZER_WARNING (CWE-401): [#def267]
rdma-core-48.0-build/rdma-core-48.0/providers/qedr/qelr_main.c: scope_hint: In function ‘qelr_device_alloc’
rdma-core-48.0-build/rdma-core-48.0/providers/qedr/qelr_main.c:294:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
# 292| return NULL;
# 293|
# 294|-> return &dev->ibv_dev;
# 295| }
# 296|
Error: CLANG_WARNING: [#def268]
rdma-core-48.0-build/rdma-core-48.0/providers/qedr/qelr_verbs.c:726:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller
# 724| }
# 725|
# 726|-> return rc;
# 727| }
# 728|
Error: CLANG_WARNING: [#def269]
rdma-core-48.0-build/rdma-core-48.0/providers/rxe/rxe.c:1575:3: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
# 1573| }
# 1574| } else
# 1575|-> memcpy(wqe->dma.sge, ibwr->sg_list,
# 1576| num_sge*sizeof(struct ibv_sge));
# 1577|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def270]
rdma-core-48.0-build/rdma-core-48.0/providers/rxe/rxe.c: scope_hint: In function ‘rxe_device_alloc’
rdma-core-48.0-build/rdma-core-48.0/providers/rxe/rxe.c:1908:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
# 1906| dev->abi_version = sysfs_dev->abi_ver;
# 1907|
# 1908|-> return &dev->ibv_dev;
# 1909| }
# 1910|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def271]
rdma-core-48.0-build/rdma-core-48.0/providers/siw/siw.c: scope_hint: In function ‘siw_device_alloc’
rdma-core-48.0-build/rdma-core-48.0/providers/siw/siw.c:887:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
# 885| return NULL;
# 886|
# 887|-> return &dev->base_dev;
# 888| }
# 889|
Error: GCC_ANALYZER_WARNING (CWE-401): [#def272]
rdma-core-48.0-build/rdma-core-48.0/providers/vmw_pvrdma/pvrdma_main.c: scope_hint: In function ‘pvrdma_device_alloc’
rdma-core-48.0-build/rdma-core-48.0/providers/vmw_pvrdma/pvrdma_main.c:196:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dev’
# 194| dev->page_size = sysconf(_SC_PAGESIZE);
# 195|
# 196|-> return &dev->ibv_dev;
# 197| }
# 198|
Error: CPPCHECK_WARNING: [#def273]
rdma-core-48.0-build/rdma-core-48.0/rdma-ndd/rdma-ndd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-688): [#def274]
rdma-core-48.0-build/rdma-core-48.0/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-0kJWJc/src.c: scope_hint: In function ‘main’
rdma-core-48.0-build/rdma-core-48.0/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-0kJWJc/src.c:4:4: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
rdma-core-48.0-build/rdma-core-48.0/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-0kJWJc/src.c:2: included_from: Included from here.
/usr/include/time.h:288:12: note: argument 2 of ‘clock_gettime’ must be non-null
Error: CLANG_WARNING: [#def275]
rdma-core-48.0-build/rdma-core-48.0/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-0kJWJc/src.c:4:4: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
Error: GCC_ANALYZER_WARNING (CWE-775): [#def276]
rdma-core-48.0-build/rdma-core-48.0/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-esGw91/src.c: scope_hint: In function ‘main’
rdma-core-48.0-build/rdma-core-48.0/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-esGw91/src.c:7:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor
Error: GCC_ANALYZER_WARNING (CWE-775): [#def277]
rdma-core-48.0-build/rdma-core-48.0/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-esGw91/src.c:8:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor
Error: CLANG_WARNING: [#def278]
rdma-core-48.0-build/rdma-core-48.0/srp_daemon/srp_daemon.c:1533:3: warning[deadcode.DeadStores]: Value stored to 'optr' is never read
# 1531| return -1;
# 1532| len = snprintf(optr, left, ",%s%s", opt[i], option);
# 1533|-> optr += len;
# 1534| left -= len;
# 1535| if (left <= 0)
Error: GCC_ANALYZER_WARNING (CWE-688): [#def279]
rdma-core-48.0-build/rdma-core-48.0/srp_daemon/srp_sync.c: scope_hint: In function ‘push_to_retry_list’
rdma-core-48.0-build/rdma-core-48.0/srp_daemon/srp_sync.c:270:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘target’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
# 268|
# 269| target = malloc(sizeof(struct target_details));
# 270|-> memcpy(target, orig_target, sizeof(struct target_details));
# 271|
# 272| pthread_mutex_lock(&res->retry_mutex);
Error: GCC_ANALYZER_WARNING (CWE-688): [#def280]
rdma-core-48.0-build/rdma-core-48.0/util/tests/bitmap_test.c:6: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/util/bitmap.h: scope_hint: In function ‘bitmap_zero’
rdma-core-48.0-build/rdma-core-48.0/util/bitmap.h:41:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘bmp’ where non-null expected
rdma-core-48.0-build/rdma-core-48.0/util/tests/bitmap_test.c: scope_hint: In function ‘bitmap_zero’
rdma-core-48.0-build/rdma-core-48.0/util/tests/bitmap_test.c:125:17: note: in expansion of macro ‘TEST’
<built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null
# 39| unsigned long size = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
# 40|
# 41|-> memset(bmp, 0, size);
# 42| }
# 43|
Error: CLANG_WARNING: [#def281]
rdma-core-48.0-build/rdma-core-48.0/util/bitmap.c:4: included_from: Included from here.
rdma-core-48.0-build/rdma-core-48.0/util/bitmap.h:100:8: warning[unix.MallocSizeof]: Result of 'calloc' is converted to a pointer of type 'unsigned long', which is incompatible with sizeof operand type 'long'
# 98| unsigned long *bmp;
# 99|
# 100|-> bmp = calloc(BITS_TO_LONGS(size), sizeof(long));
# 101| if (!bmp)
# 102| return NULL;
Error: CPPCHECK_WARNING: [#def282]
rdma-core-48.0-build/rdma-core-48.0/util/cl_map.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def283]
rdma-core-48.0-build/rdma-core-48.0/util/cl_map.c:631:4: warning[deadcode.DeadStores]: Value stored to 'p_item2' is never read
# 629| if (p_item2 != p_item) {
# 630| /* Put the item in back in the source map. */
# 631|-> p_item2 =
# 632| cl_qmap_insert(p_src_map, cl_qmap_key(p_item),
# 633| p_item);
Error: CPPCHECK_WARNING: [#def284]
rdma-core-48.0-build/rdma-core-48.0/util/node_name_map.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def285]
rdma-core-48.0-build/rdma-core-48.0/util/tests/bitmap_test.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Scan Properties
analyzer-version-clang | 18.1.7 |
analyzer-version-cppcheck | 2.14.2 |
analyzer-version-gcc | 14.1.1 |
analyzer-version-gcc-analyzer | 14.1.1 |
analyzer-version-shellcheck | 0.10.0 |
enabled-plugins | clang, cppcheck, gcc, shellcheck |
exit-code | 0 |
host | ip-172-16-1-112.us-west-2.compute.internal |
mock-config | fedora-41-x86_64 |
project-name | rdma-core-48.0-4.fc40 |
store-results-to | /tmp/tmpuqcql5xc/rdma-core-48.0-4.fc40.tar.xz |
time-created | 2024-07-03 17:48:40 |
time-finished | 2024-07-03 17:52:29 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpuqcql5xc/rdma-core-48.0-4.fc40.tar.xz' '--gcc-analyze' '/tmp/tmpuqcql5xc/rdma-core-48.0-4.fc40.src.rpm' |
tool-version | csmock-3.5.3-1.el9 |