From patchwork Mon Sep 9 16:57:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yong Liang <1269690261@qq.com> X-Patchwork-Id: 143831 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 398EC4594A; Mon, 9 Sep 2024 18:58:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C90B340ED8; Mon, 9 Sep 2024 18:58:04 +0200 (CEST) Received: from xmbghk7.mail.qq.com (xmbghk7.mail.qq.com [43.163.128.44]) by mails.dpdk.org (Postfix) with UTF8SMTP id E946740ED0 for ; Mon, 9 Sep 2024 18:58:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1725901074; bh=Wu8X3eV2Lg0cDx3fRZSrqxXrwdxmVyTQ+AZkY+7fsqo=; h=From:To:Cc:Subject:Date; b=UAO1H7H2SFIazDKWy7pb4++fM8lUVC8ODpJp6dz9Rl+1BtcifFl4IOXLzRgv+obNx /oRbAa6/HYIE5tND9NwtbbWdQSEbYQ+eybIxSlnJttzvXk1MCa+ZnHy0/FMWlEEBmp xCaXuDrL96NqI7D/o+zJvgTIMYxmsMGnq3saAQwE= Received: from localhost.localdomain ([113.104.214.202]) by newxmesmtplogicsvrsza15-1.qq.com (NewEsmtp) with SMTP id E7530C4B; Tue, 10 Sep 2024 00:57:53 +0800 X-QQ-mid: xmsmtpt1725901073tcz2qzhzl Message-ID: X-QQ-XMAILINFO: N9EPLMmBbt0Dw+EaZ2dcIBl8HAoc7XGDYy1ARogZLTwGC9XRUF/GULzqSg2QP8 YE+2jpcR8DvgMnkM20ozpT8uEfFcCqdYNLZd+fCxLRECnDrRJJQvK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pdk.org Cc: kai.ji@intel.com Subject: [PATCH] Coverity issue: Failure to enqueue packets for cryptodev-scheduler_multicore can lead to program crashes Bugzilla ID: 1537 Fixes: replace `pending_deq_ops` with `pending_enq_ops` Cc: stable@dpdk.org Date: Tue, 10 Sep 2024 00:57:41 +0800 X-OQ-MSGID: <20240909165741.2317-1-1269690261@qq.com> X-Mailer: git-send-email 2.46.0.windows.1 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Signed-off-by: Yong Liang <1269690261@qq.com> --- drivers/crypto/scheduler/scheduler_multicore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/scheduler/scheduler_multicore.c b/drivers/crypto/scheduler/scheduler_multicore.c index a21b522f9f..70f8a25b70 100644 --- a/drivers/crypto/scheduler/scheduler_multicore.c +++ b/drivers/crypto/scheduler/scheduler_multicore.c @@ -191,11 +191,11 @@ mc_scheduler_worker(struct rte_cryptodev *dev) worker->qp_id, &enq_ops[pending_enq_ops_idx], pending_enq_ops); - if (processed_ops < pending_deq_ops) + if (processed_ops < pending_enq_ops) scheduler_retrieve_sessions( &enq_ops[pending_enq_ops_idx + processed_ops], - pending_deq_ops - processed_ops); + pending_enq_ops - processed_ops); pending_enq_ops -= processed_ops; pending_enq_ops_idx += processed_ops; inflight_ops += processed_ops;