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 D785345A50; Sat, 28 Sep 2024 18:49:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C73C40A6D; Sat, 28 Sep 2024 18:48:49 +0200 (CEST) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id 8FECA40657 for ; Sat, 28 Sep 2024 18:48:38 +0200 (CEST) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-206aee4073cso34929575ad.1 for ; Sat, 28 Sep 2024 09:48:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727542118; x=1728146918; 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=r6VkJ92mBLUEs6ASZ/C5jiwDh9VNT1k7ZVgRfmsZ+TFlOtscfDlwwU/winkEVJXjwd s0vznS8gykYabhvuz3Zte+dXLYP3XYyiA+Tpi2Jh3KQGzSyVW/WR4eKfITYhJfgWiyD5 NTKi8ctLVqdyZS1hyMOybK93eh0wHuh6samF8nEp85YTjAWE1IuP6kRv7cIAWazyQiuX rEAeiSS8apucBkWyLmgAwc6h0+72eSCGbGphcNIrmailHzasna05e2MDwsQTwbqAeBwK 5IsTBm/hqw1Tof7FBqKkRQG62w3ABk1gOL1MLQEPx84sREWdSYLZG/OfllIiJN+YWuub VZFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727542118; x=1728146918; 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=lnLcflWa/bXzbKCTjIft7U6DtZ7yFtoIFVkqD32E7XMGF6jpe6cLAaQgKH6OS73Fvo nb//fBmNddagFUfto/6z94EWJKQQvFaHZ6Poknl2wGZ98xPwGtWVKiTMeFutSTnLwPRg aJPq1Hjp7cNvUK2IuRWIJUAxlvI8Dw6QTX++r8XMFS5VzX3t53XJTzHJiiA+G36ji13Z lM03OF2Z196vqeerbR73OruZDNuORcZ1R/5nSGhEcCiSe2oDfg9kBFUVOCTEa8X/mGMH daffUqapMtIMyZjQ21SmskTzjtaB53DJkq6jH+ho3EaSUnnTjrYmgWOJtm75aq0L3F7L FFnA== X-Gm-Message-State: AOJu0YySddjfpN9a00wkBjwxuVEv1LSn8E9Zd0AeUXLRhjSLo6tePiZ6 qZWWITmVWhlHdaFgo+0rxZx2AQJd7qF54YcVnDwwXXxE2x6KSqRzs3PTKuOngr20rx8x0slUi+f Q X-Google-Smtp-Source: AGHT+IFwRSopIx6mTyy100L1Bt42MEI/3JnNcp0IVpZcSx0YxeeJXwjdWrUD+eraGbXqqwaJWpjBjw== X-Received: by 2002:a17:902:e882:b0:202:3a49:acec with SMTP id d9443c01a7336-20b367d02bemr123168655ad.11.1727542117792; Sat, 28 Sep 2024 09:48:37 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e47c7dsm28854015ad.216.2024.09.28.09.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Sep 2024 09:48:37 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , arkadiuszx.kusztal@intel.com, Kai Ji , Ciara Power Subject: [PATCH v2 14/16] common/qat: fix use after free Date: Sat, 28 Sep 2024 09:47:22 -0700 Message-ID: <20240928164814.861933-15-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240928164814.861933-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20240928164814.861933-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