From patchwork Thu Sep 5 09:32:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Ostruszka X-Patchwork-Id: 58627 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 532101EE1A; Thu, 5 Sep 2019 11:32:47 +0200 (CEST) Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by dpdk.org (Postfix) with ESMTP id 9D1891EDA9 for ; Thu, 5 Sep 2019 11:32:42 +0200 (CEST) Received: by mail-lf1-f67.google.com with SMTP id j4so1406167lfh.8 for ; Thu, 05 Sep 2019 02:32:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NmBqw+BMLzZ/8Flgo8FLKyEvK1Io2QD3hAZums/97J4=; b=keqD3UUJ3TaOPTt26W1YdHED9zKHEa4w+XzsKZ1YjORbMq9SiR+e/LJo7qN/jxutwI 5hCfIilDLngtj92V7dR9N0HZ9Dd/FOYBPmFkEIgiNuXT97CXGj8alOxAVaZdZZ+GF9P2 6Al5L5IsnbRqTGptwyrNYdlRv26miKmtEZ9GA4xtmMqJSzLYPfW76GpoSRolIg7SXlv/ GMM7t1UxTKvm4V+6cIeMvwfdVpmDTxJ8sgiArLd22/kEHOyhjGA/PtZWLcaq4Bw8K6+b QxiMcN95h6nPrJBg/+J4iM2eU4sjkiT3f2pdRGMq2/I+iffjscW3PFrbSNWHvNMDg2Bb yxHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NmBqw+BMLzZ/8Flgo8FLKyEvK1Io2QD3hAZums/97J4=; b=SZhJ3b8VeGv7kipISq7R3A2pDHxjZZQiieuuMfaiIx5t2Whx+dOkLZzfni9vRiwvu5 R5VrxJ9k/2i1PMe4OOC5xwq7XgDNEwyUR6DVfoFLBz1mwJkx07U9Nhk1UAkPJFlONyml CkTnJbiiL7R0HAGej75WTJYFUly0ngegizSwXAbAsGzIQcWCtTemVB7Yl+qjY/PAPGxx bWJ/zimergc4FuaWDQ/yUMxa0Wwh4rtrkPnOKhhMon/+Ro29nxiS+sCQ0W2rXMEpmubF Ff6Cm+rgu2XupNfDNiepKXDonl3d5JYMqL9M+SsMUIayqO/FsI3N9jG0xpEFwLckF3by 7bxA== X-Gm-Message-State: APjAAAUzzJbKtQIdd8ufcEJ3k41yadTQv296zG4RtLDMwQ+clMGZlV0Z idzbe3Yg2HYFZ2Vp+CvrFkkl1wcTUYCk0A== X-Google-Smtp-Source: APXvYqyLSWt9VYxPqB+WPzE9CUXBMq91eDE2OEg/v/ZkuuKR+Ez9NCW6UgZ+QHv4koz6CUPay3Uejg== X-Received: by 2002:ac2:52b6:: with SMTP id r22mr1718085lfm.19.1567675962106; Thu, 05 Sep 2019 02:32:42 -0700 (PDT) Received: from localhost.localdomain (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id b25sm363060lfa.90.2019.09.05.02.32.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 02:32:41 -0700 (PDT) From: Andrzej Ostruszka To: dev@dpdk.org Cc: Andrzej Ostruszka Date: Thu, 5 Sep 2019 11:32:31 +0200 Message-Id: <20190905093239.27187-3-amo@semihalf.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190905093239.27187-1-amo@semihalf.com> References: <20190905093239.27187-1-amo@semihalf.com> Subject: [dpdk-dev] [PATCH 02/10] eventdev: fix possible use of uninitialized var X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fix the logic for the case of event queue allowing all schedule types. Signed-off-by: Andrzej Ostruszka --- lib/librte_eventdev/rte_event_timer_adapter.c | 8 ++++---- 1 file 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 5ce399eca..161e21a68 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