https://bugs.linaro.org/show_bug.cgi?id=2223
Bug ID: 2223
Summary: Coverity issues with Monarch RC2 Traffic Manager
Product: OpenDataPlane - linux- generic reference
Version: v1.10
Hardware: Other
OS: Linux
Status: UNCONFIRMED
Severity: enhancement
Priority: ---
Component: Traffic Manager
Assignee: lng-odp@lists.linaro.org
Reporter: bill.fischo...@linaro.org
CC: lng-odp@lists.linaro.org
Target Milestone: ---
*** CID 161199: Code maintainability issues (UNUSED_VALUE)
/test/validation/traffic_mngr/traffic_mngr.c: 3405 in test_ip_marking()
3399
3400 /* Next enable IP TOS marking for just the given color
parameter */
3401 if ((!test_ecn) && (!test_drop_prec))
3402 return 0;
3403
3404 if (test_ecn)
>>> CID 161199: Code maintainability issues (UNUSED_VALUE)
>>> Assigning value from "odp_tm_ecn_marking(odp_tm, pkt_color, 1)" to "rc"
>>> here, but that stored value is overwritten before it can be used.
3405 rc = odp_tm_ecn_marking(odp_tm, pkt_color, true);
3406
3407 if (test_drop_prec)
3408 rc = odp_tm_drop_prec_marking(odp_tm, pkt_color, true);
3409
3410 tm_queue = find_tm_queue(0, node_name, 0);
** CID 161198: Code maintainability issues (UNUSED_VALUE)
/test/validation/traffic_mngr/traffic_mngr.c: 3408 in test_ip_marking()
________________________________________________________________________________________________________
*** CID 161198: Code maintainability issues (UNUSED_VALUE)
/test/validation/traffic_mngr/traffic_mngr.c: 3408 in test_ip_marking()
3402 return 0;
3403
3404 if (test_ecn)
3405 rc = odp_tm_ecn_marking(odp_tm, pkt_color, true);
3406
3407 if (test_drop_prec)
>>> CID 161198: Code maintainability issues (UNUSED_VALUE)
>>> Assigning value from "odp_tm_drop_prec_marking(odp_tm, pkt_color, 1)"
>>> to "rc" here, but that stored value is overwritten before it can be used.
3408 rc = odp_tm_drop_prec_marking(odp_tm, pkt_color, true);
3409
3410 tm_queue = find_tm_queue(0, node_name, 0);
3411 if (tm_queue == ODP_TM_INVALID) {
3412 LOG_ERR("No tm_queue found for node_name='%s'\n",
node_name);
3413 return -1;
** CID 161197: Control flow issues (UNREACHABLE)
/test/validation/traffic_mngr/traffic_mngr.c: 1635 in dump_tm_tree()
________________________________________________________________________________________________________
*** CID 161197: Control flow issues (UNREACHABLE)
/test/validation/traffic_mngr/traffic_mngr.c: 1635 in dump_tm_tree()
1629
1630 static void dump_tm_tree(uint32_t tm_idx)
1631 {
1632 tm_node_desc_t *root_node_desc;
1633
1634 return;
>>> CID 161197: Control flow issues (UNREACHABLE)
>>> This code cannot be reached: "root_node_desc = root_node_...".
1635 root_node_desc = root_node_descs[tm_idx];
1636 dump_tm_subtree(root_node_desc);
1637 }
1638
1639 static int unconfig_tm_queue_profiles(odp_tm_queue_t tm_queue)
1640 {
** CID 161195: Memory - illegal accesses (OVERRUN)
/platform/linux-generic/odp_traffic_mngr.c: 2651 in odp_tm_vlan_marking()
________________________________________________________________________________________________________
*** CID 161195: Memory - illegal accesses (OVERRUN)
/platform/linux-generic/odp_traffic_mngr.c: 2651 in odp_tm_vlan_marking()
2645
2646 tm_system = GET_TM_SYSTEM(odp_tm);
2647 if ((tm_system == NULL) || (ODP_NUM_PACKET_COLORS < color))
2648 return -1;
2649
2650 if (drop_eligible_enabled)
>>> CID 161195: Memory - illegal accesses (OVERRUN)
>>> Overrunning array "tm_system->requirements.marking_colors_needed" of 3
>>> 4-byte elements at element index 3 (byte offset 12) using index "color"
>>> (which evaluates to 3).
2651 if ((!tm_system->requirements.vlan_marking_needed) ||
2652
(!tm_system->requirements.marking_colors_needed[color]))
2653 return -2;
2654
2655 vlan_marking = &tm_system->marking.vlan_marking[color];
2656 vlan_marking->marking_enabled = drop_eligible_enabled;
** CID 161194: Memory - corruptions (OVERRUN)
/platform/linux-generic/odp_traffic_mngr.c: 2656 in odp_tm_vlan_marking()
________________________________________________________________________________________________________
*** CID 161194: Memory - corruptions (OVERRUN)
/platform/linux-generic/odp_traffic_mngr.c: 2656 in odp_tm_vlan_marking()
2650 if (drop_eligible_enabled)
2651 if ((!tm_system->requirements.vlan_marking_needed) ||
2652
(!tm_system->requirements.marking_colors_needed[color]))
2653 return -2;
2654
2655 vlan_marking = &tm_system->marking.vlan_marking[color];
>>> CID 161194: Memory - corruptions (OVERRUN)
>>> Overrunning array of 3 8-byte elements at element index 3 (byte offset
>>> 24) by dereferencing pointer "vlan_marking".
2656 vlan_marking->marking_enabled = drop_eligible_enabled;
2657 vlan_marking->drop_eligible_enabled = drop_eligible_enabled;
2658 if (vlan_marking->marking_enabled)
2659 tm_system->marking_enabled = true;
2660 else
2661 tm_system->marking_enabled =
tm_marking_enabled(tm_system);
______________________________________
*** CID 161190: Control flow issues (DEADCODE)
/test/validation/traffic_mngr/traffic_mngr.c: 3364 in check_tos_marking_pkts()
3358 * probably a stray pkt from a previous test.
*/
3359 LOG_ERR("Pkt rcvd with invalid pkt class=%u\n",
3360 pkt_class);
3361 }
3362 }
3363
>>> CID 161190: Control flow issues (DEADCODE)
>>> Execution cannot reach the expression "-1" inside this statement:
>>> "return (err_cnt == 0U) ? 0 ...".
3364 return (err_cnt == 0) ? 0 : -1;
3365 }
3366
3367 static int test_ip_marking(const char *node_name,
3368 odp_packet_color_t pkt_color,
3369 odp_bool_t use_ipv6,
--
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp