Bala, can you please send v2 with CLS_L2_QOS_MAX and without num_qos? Or use second option which is faster.

Maxim.

On 02/24/2015 11:25 AM, Bala wrote:

On Tuesday 24 February 2015 01:46 PM, Maxim Uvarov wrote:
On 02/24/2015 11:14 AM, Maxim Uvarov wrote:
On 02/23/2015 07:10 AM, [email protected] wrote:
From: Balasubramanian Manoharan <[email protected]>

Fixes uninitialized scalar variable qos_tbl in configure_cos_with_l2_priority()
function reported by Coverity.

https://bugs.linaro.org/show_bug.cgi?id=1143

Signed-off-by: Balasubramanian Manoharan <[email protected]>
---
  test/validation/classification/odp_classification_tests.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c
index 564455c..4807584 100644
--- a/test/validation/classification/odp_classification_tests.c
+++ b/test/validation/classification/odp_classification_tests.c
@@ -555,6 +555,10 @@ void configure_cos_with_l2_priority(void)
      int i;
      odp_queue_param_t qparam;
  +    /** Initialize scalar variable qos_tbl **/
+    for (i = 0; i < CLS_L2_QOS_MAX; i++)
+        qos_tbl[i] = 0;
+
      qparam.sched.sync = ODP_SCHED_SYNC_NONE;
      qparam.sched.group = ODP_SCHED_GROUP_ALL;
      for (i = 0; i < num_qos; i++) {
Bala, one small note. In first case "for .. CLS_L2_QOS_MAX", in second case "for num_qos", which has the same value. Just to be consistent can you remove num_qos variable from that function? It's not needed.

Maxim.



And might  be that code will be better::
                if (cos_tbl[i] == ODP_COS_INVALID) {
                    qos_tbl[i] = 0;
                    break;
                }
qos_tbl gets initialized to zero in the beginning so this might not be needed.

Regards,
Bala

Maxim.


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp



_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to