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 ACD4F45A7E; Tue, 1 Oct 2024 18:38:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1B3CE40DD7; Tue, 1 Oct 2024 18:37:40 +0200 (CEST) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by mails.dpdk.org (Postfix) with ESMTP id EBBDF406B7 for ; Tue, 1 Oct 2024 18:37:30 +0200 (CEST) Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-7d666fb3fb9so3171758a12.0 for ; Tue, 01 Oct 2024 09:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727800650; x=1728405450; 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=HEygySitlNS+YA3Y7eXd8Z0MJrikf9aZZGGfPD9VIZnSwAc8/g0ZTE9H6+bFd00mgG fyeNvtkVTrOE4v3WKXtNqMKZmHxDbBrEOrl26E5y5v9qKxrmG6dBxd4vRnlxs9jv3BxK HH/zCkRaF1ROEnM3D8xh8RhJjkPOAl2cXP37kCFiHkVHRsem3hfOYGTH1RI1MV5sQKMh ZeSQbX7uu3EKJ1ngrNgc64+nMQPQIxeqyB5KXnmwuIkBFedNcfYN1uTXBLYOdWUKUqcc l/J3FeG/s8N/zeOIR0ueWTh5yYQ1aGSeAwde1Hrz2QMqq5IThdcVK2X7seEuWFjE3z9P AVTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727800650; x=1728405450; 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=lrTTILhpPsb4tXMYT2ird7bA/aUvjPyvc5OHru1b/ZIZb0GV5h2h8YDml2HoKkzeDb SDpnQQrXa517/Vyi3K5l6RMe8bHu+BiJ2Xxf8Gty6/Iqd3wYFdzezHHcd/rhzxAROhqc dLsxq7vUCw+Dt6H2usNgToI5zjqfW1IftReIsMiu267oCAEA8GJZ3uFunvX6FgyG8ZKZ xRskiqHP4m+AcRZjr0f3ckD1ENdzd/angLZWmzqYxzyfzqec6BEKUW6+W7mWhC99NAAl El154Iz+W1jqKyNEeGNeMCeK1VSuxeZ2G36B7Z5uCPcHLJDfiRotJrt89WBaCkz/metf oO1A== X-Gm-Message-State: AOJu0YxrwMpeM7dkxBmCgFlsnzlzYeCL7wASoXKf3L5kVsMb+JlQS4qU HdopkQ69L1Xj7W9HthZHRkD+rRc3kwpySupRVjZWsDEKywZLMcj2g+Pb4Z9F+9V5QgTxtnSbxcl 7mNg= X-Google-Smtp-Source: AGHT+IHLic4QHBNb3R3l0OeAvYkr2H93rxEStEvBjD57BzPXZmJE+r1X/PYpq2kHdaqod6Wfdr6znQ== X-Received: by 2002:a05:6a20:b043:b0:1d6:8aab:2ed1 with SMTP id adf61e73a8af0-1d68aab308emr9617637.0.1727800650182; Tue, 01 Oct 2024 09:37:30 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b26518818sm8213565b3a.129.2024.10.01.09.37.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 09:37:29 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , arkadiuszx.kusztal@intel.com, Kai Ji , Ciara Power Subject: [PATCH v5 13/17] common/qat: fix use after free Date: Tue, 1 Oct 2024 09:35:36 -0700 Message-ID: <20241001163708.355128-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241001163708.355128-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241001163708.355128-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