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 C1C9345A5D; Sun, 29 Sep 2024 17:42:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 68074406B8; Sun, 29 Sep 2024 17:41:41 +0200 (CEST) Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by mails.dpdk.org (Postfix) with ESMTP id ABACC4065B for ; Sun, 29 Sep 2024 17:41:30 +0200 (CEST) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-71b8d10e990so1336260b3a.3 for ; Sun, 29 Sep 2024 08:41:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727624490; x=1728229290; 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=QG09mSzzBy9BBlahicHQPvKa5Qi0x5cK3ceB5vkhfHoTKuitAwgrrUlt+Vy+qLuzXA 6P4BWendJfeJE6E82T7OPNFCLVjjI0m46P1UXjjDqFC7fGS+FX3vSEYkhRD/gNi+fHn2 9dmo537T8sd5yHpR0qFEdU5CIthqdQY4hRSYtgSJmEye7+Z9Xpe7NqQQkq9CEUUXVua3 3gHwSHGmF9j9Lf7wgDpmX/123jkJuQj2BrbvdpAfeDzz9QLwA0v4+hCzfGTHLSvIuwAp V0VKn+teXRYflEMxiJk6KLmXPqvXhnRUIUdoe7AiR/X5bCsXw9R6plOpgogPVnuQ11f3 G2yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727624490; x=1728229290; 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=JfvBB5z9HMmRsRq408Axt8Iz9bboYlw+rR/jjdtEK42BN0UtrviT75MwJ0JkcqpLYS RjsiXyxke8EuB7tGkzGM/qZs4mEEe2PuH8C+XgZ6dyWtm7dSQnxtgHhUbihisxVnt5dF JCORFzDrFORoLW9sMZqcVEzwLXwYh4EdnhESA501SgjqX7OUDujRm+88Q2PQkGIq2iz0 YnzoPdE5VTK810kv2/RnjJ+recdnelYVBZOPztIv3iXqg7LuQ6bQ4YQOsXKdZHB3MT0P a+cV5oXtQ9UU826mTX1e+rAhYWJ3tJOzyd2zNHPl+gtAo6J5CI8SclE+PKxACQ0MLhgm onhQ== X-Gm-Message-State: AOJu0Yx5no6EEPRtMRvF9J8brh5PgYQcjWD17t4ILd/B4Wnfds4ZXaWZ Tm2j50pvH6px8qyUtFHShapUek25uncVu1y+ojgPmrlI73Moa18vm8oh8wT+SOu0oMw7sZIOOSm qFpc= X-Google-Smtp-Source: AGHT+IGN9pu3fSlVlOPFPOd0HB7Q22rZnRx/IaSX9fmuBXea2drKRl5LM0sDI5urnelgTrvVY3i9ww== X-Received: by 2002:a05:6a00:114e:b0:714:1fc3:7a00 with SMTP id d2e1a72fcca58-71b2604408bmr15286961b3a.18.1727624489887; Sun, 29 Sep 2024 08:41:29 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b2649c775sm4707416b3a.29.2024.09.29.08.41.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2024 08:41:29 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , arkadiuszx.kusztal@intel.com, Kai Ji , Ciara Power Subject: [PATCH v3 13/18] common/qat: fix use after free Date: Sun, 29 Sep 2024 08:34:38 -0700 Message-ID: <20240929154107.62539-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240929154107.62539-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20240929154107.62539-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