Fixes: 4236ce9bf5bf ("event/opdl: add OPDL ring infrastructure library")
Coverity issue: 257022

Signed-off-by: Liang Ma <liang.j...@intel.com>
---
 drivers/event/opdl/opdl_ring.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/event/opdl/opdl_ring.c b/drivers/event/opdl/opdl_ring.c
index 7e16d4d..39dc41d 100644
--- a/drivers/event/opdl/opdl_ring.c
+++ b/drivers/event/opdl/opdl_ring.c
@@ -550,6 +550,10 @@ opdl_stage_claim_multithread(struct opdl_stage *s, void 
*entries,
        uint32_t i = 0, offset;
        uint8_t *entries_offset = (uint8_t *)entries;
 
+       if (seq == NULL) {
+               PMD_DRV_LOG(ERR, "Invalid seq PTR");
+               return 0;
+       }
        offset = opdl_first_entry_id(*seq, s->nb_instance, s->instance_id);
        num_entries = offset + (s->nb_instance * num_entries);
 
@@ -561,8 +565,8 @@ opdl_stage_claim_multithread(struct opdl_stage *s, void 
*entries,
                entries_offset += t->slot_size;
                i++;
        }
-       if (seq != NULL)
-               *seq = old_head;
+
+       *seq = old_head;
 
        return i;
 }
-- 
2.7.5

Reply via email to