diff options
author | Matias Elo <matias.elo@nokia.com> | 2021-05-24 13:13:17 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2021-05-26 15:56:31 +0300 |
commit | e8b64ef3387f86f0b524cd0ce99c2c3e94f9c367 (patch) | |
tree | 83168b6e65bcad740cef48ceb916f29100c909c2 /platform/linux-dpdk/odp_schedule_eventdev.c | |
parent | 254e6cbb0bb6ca9b46e20cc8d6de0c6bebeea9ea (diff) |
linux-dpdk: eventdev: fix uninitialized usage warning
Fix uninitialized usage warning thrown by GCC with CFLAGS=-O1.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Diffstat (limited to 'platform/linux-dpdk/odp_schedule_eventdev.c')
-rw-r--r-- | platform/linux-dpdk/odp_schedule_eventdev.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/linux-dpdk/odp_schedule_eventdev.c b/platform/linux-dpdk/odp_schedule_eventdev.c index 7b4ddef60..8dc5470f9 100644 --- a/platform/linux-dpdk/odp_schedule_eventdev.c +++ b/platform/linux-dpdk/odp_schedule_eventdev.c @@ -539,7 +539,12 @@ static inline uint16_t event_input(struct rte_event ev[], odp_event_t out_ev[], uint16_t num_pkts = 0; uint16_t num_events = 0; uint16_t i; - uint8_t first_queue = ev[0].queue_id; + uint8_t first_queue; + + if (odp_unlikely(nb_events == 0)) + return 0; + + first_queue = ev[0].queue_id; for (i = 0; i < nb_events; i++) { struct rte_event *event = &ev[i]; |