summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Ostruszka <aostruszka@marvell.com>2019-11-07 16:03:10 +0100
committerThomas Monjalon <thomas@monjalon.net>2019-11-08 15:17:24 +0100
commit57e20572ac67a55874a206ef7339443b0950705d (patch)
treeeab176ffc973394c499c27d7b09b24da6e53ee9c
parent098cc0fea3be3094a5f0691d1ae501c83fe0d687 (diff)
downloaddpdk-57e20572ac67a55874a206ef7339443b0950705d.zip
dpdk-57e20572ac67a55874a206ef7339443b0950705d.tar.gz
dpdk-57e20572ac67a55874a206ef7339443b0950705d.tar.xz
eventdev: fix possible use of uninitialized var
Fix the logic for the case of event queue allowing all schedule types. Compiler warning pointing to this error (with LTO enabled): error: ‘sched_type’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if ((ret < 0 && ret != -EOVERFLOW) || Fixes: 6750b21bd6af ("eventdev: add default software timer adapter") Cc: stable@dpdk.org Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com> Reviewed-by: Jerin Jacob <jerinj@marvell.com>
-rw-r--r--lib/librte_eventdev/rte_event_timer_adapter.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c
index 5ce399e..161e21a 100644
--- a/lib/librte_eventdev/rte_event_timer_adapter.c
+++ b/lib/librte_eventdev/rte_event_timer_adapter.c
@@ -706,11 +706,11 @@ check_destination_event_queue(struct rte_event_timer *evtim,
RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE,
&sched_type);
- if ((ret < 0 && ret != -EOVERFLOW) ||
- evtim->ev.sched_type != sched_type)
- return -1;
+ if ((ret == 0 && evtim->ev.sched_type == sched_type) ||
+ ret == -EOVERFLOW)
+ return 0;
- return 0;
+ return -1;
}
static int