Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page:

platform/linux-generic/odp_classification.c
line 5
@@ -250,7 +250,7 @@ odp_cos_t odp_cls_cos_create(const char *name, 
odp_cls_cos_param_t *param)
                                cos->s.num_queue = param->num_queue;
                                _odp_cls_update_hash_proto(cos,
                                                           param->hash_proto);
-                               tbl_index = cos->s.index * CLS_COS_QUEUE_MAX;
+                               tbl_index = i * CLS_COS_QUEUE_MAX;


Comment:
Since we're bug fixing here, if the `odp_queue_create()` call below fails, it 
should unwind the previous successful creates before returning 
`ODP_COS_INVALID` to avoid leaking queues:
```
for (j = 0; j < CLS_COS_QUEUE_MAX; j++) {
        queue = odp_queue_create(NULL, &cos->s.queue_param);
        if (queue == ODP_QUEUE_INVALID) {
                while (j > 0) 
                    odp_queue_destroy(queue_grp_tbl->s.queue[tbl_index + j--]);
                UNLOCK(&cos->s.lock);
                return ODP_COS_INVALID;
        }
        queue_grp_tbl->s.queue[tbl_index + j] = queue;
}
```
This could be a separate commit or PR as you prefer.

https://github.com/Linaro/odp/pull/405#discussion_r162429590
updated_at 2018-01-18 18:34:35

Reply via email to