From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2332645A48; Fri, 27 Sep 2024 22:49:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5CFA740B8C; Fri, 27 Sep 2024 22:48:19 +0200 (CEST) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by mails.dpdk.org (Postfix) with ESMTP id 532D040669 for ; Fri, 27 Sep 2024 22:48:09 +0200 (CEST) Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-7db1f13b14aso2086658a12.1 for ; Fri, 27 Sep 2024 13:48:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727470088; x=1728074888; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CeP4jlg/nwoX9BqyloYvigRPb4ZdUkxrz0ArQrEvutk=; b=opE2rnIo+MjTCMEouwH8gBVOwZ3B6gAy4u0/S4xrpUIep6fu1dkHcB1kT7iIHUB/O9 cNdhwBG1X6oZJDyNny0hG6OhR9qz84qFlezhJFTGjqtCncK/YOGHkTOvQSA8dGo6cq88 Qvd6QhASpHfdXFPAeq3T4/qy/w7wjqXAiKJDi5+oi4+M8f5BU77fpzveBDGtJoJEZFL2 bVGE0Hrr/IO6HZPvPLwv1/QI5hJMZZMnD7B+TD/NZGOzEQKAjhGtWp8OaC0dFdkvGiN6 Z/IcpjPzGERHqctG2q/f9YKG7PfIdsLGyOw661vEYlwDnLQBzn1PQ1oFNS1thdSZltHN A0WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727470088; x=1728074888; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CeP4jlg/nwoX9BqyloYvigRPb4ZdUkxrz0ArQrEvutk=; b=cVz+qEqj6nVLRYDtOFny+Qchazw8pgz4Wjahf0LQ4oLMryY3w9dIsAzun/vkoIAi8U YXabl2JS8+5K2ReZLOxTd/GCZ8f2d7fhkk8yfb8itvoDA4neSfBrYE/8FSs9s1vitOSC xlNxYddBcdxNoJmnp4ti1OhBh4HMMge/781T6PgbjhbPAkZRMmP+uH1/RYaeuSmYAtpD CESoCcntOcDkM1ZtbMdnB0AV2qYrHPdt37qPA5JmyqQAB217tnGoJbikKsY5VwNoKad0 NZEvA2N+/dblPbpxmNWxcuLC/dLkRbimSG1rZ4pK9lqf6vQ3KF9HEqh4IKtBTcjbfVlO BSrw== X-Gm-Message-State: AOJu0YxPN6lEIIoqsabahJ6tJy4eMNhajcYDfXNlk8k/gfF9PwdW4dOS 9jSWPpe+mqgtmwg+c7wlF9CumBqoyUH+DgXD26d9GgXMxdpC0lJbcSwtX6BsQKJVZdt89dnnh4Q 3 X-Google-Smtp-Source: AGHT+IEcCpxKdoRMV5IPAOoH73Al/D7kB9Fv/XwEOVzy78Sioq+wm1c7zprSHCT7/Hr5x9PW5oCbtw== X-Received: by 2002:a05:6a21:6b0b:b0:1d4:e68c:2eb9 with SMTP id adf61e73a8af0-1d4fa68f711mr6991459637.20.1727470088523; Fri, 27 Sep 2024 13:48:08 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6db294533sm2036531a12.12.2024.09.27.13.48.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2024 13:48:08 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , arkadiuszx.kusztal@intel.com, Kai Ji , Ciara Power Subject: [PATCH 13/16] common/qat: fix use after free Date: Fri, 27 Sep 2024 13:45:49 -0700 Message-ID: <20240927204742.546164-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240927204742.546164-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Checking return value of rte_memzone_free() is pointless and if it failed then it was because the pointer was null. Fixes: 7b1374b1e6e7 ("common/qat: limit configuration to primary process") Cc: arkadiuszx.kusztal@intel.com Signed-off-by: Stephen Hemminger --- drivers/common/qat/qat_device.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c index 4a972a83bd..bca88fd9bd 100644 --- a/drivers/common/qat/qat_device.c +++ b/drivers/common/qat/qat_device.c @@ -390,11 +390,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev) return qat_dev; error: rte_free(qat_dev->command_line); - if (rte_memzone_free(qat_dev_mz)) { - QAT_LOG(DEBUG, - "QAT internal error! Trying to free already allocated memzone: %s", - qat_dev_mz->name); - } + rte_memzone_free(qat_dev_mz); return NULL; } -- 2.45.2