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 3CF0745AE2; Tue, 8 Oct 2024 17:45:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30EB140ED1; Tue, 8 Oct 2024 17:43:33 +0200 (CEST) Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by mails.dpdk.org (Postfix) with ESMTP id 3164440E1E for ; Tue, 8 Oct 2024 17:43:24 +0200 (CEST) Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-71dfc250001so2119549b3a.2 for ; Tue, 08 Oct 2024 08:43:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728402203; x=1729007003; 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=vX/iMssFxT+sTjrH2APT8sDrBbcFcl6xCU3TtjK1cGF3jxy6CoBnue5OdFZVllXtuH /a4jzAljRgnTRmEIbPcjeBqU6nz2y03gqpkn9ao2AeVeBQotytSAU5OIeFzc9CCUoa/R Zhq4lpbMQiWnlfKcLCWjM2vZYb+DvrXpXzESaM7wTpdxERt2SCfCspdsP0qVzhqSs9X+ FmDpYexL2MJ+qfD2EroOb7NTWIOLp5chRy7hCLKyVirAVcrxjQGkezmJi+2kPyxwixt4 xz/zUJT9uIsSyp7HBs3rf7Qy4fCp493INVSykpNwcZyl33uxB0yeeqmBIOvV5fHPc+5i GHSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728402203; x=1729007003; 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=kuL3RJpOVPYzA/DyfO0cVhxD+D02pI/zchaZZOoXVWNS1VtflP8JjZswoV53flh/wE mV2TSlPmYgMmS0GxwUgT2UTJgk3Gb8K7VNpmdfIH/5EG2cpXqLreRuY0z6k55wR8FFe3 YzTk0Ttrea+qMHAJWAFIS47QSFQEfpzw5RhG7YbQQvUlkiPDUBJpa6//UnJfTHUoWeTN Ar6Z4gCWVM9U9tpTPWDtprEDmPHtYVI9FCdYmuNWqqc2n4+A+r1lJgZJjQln2HRRHBi5 C8pbSK+woujhLprxlHhriJHelbAQsJRObc2k828O8YCU/OupXKVELxMAEscOUNFKX7Gh 957w== X-Gm-Message-State: AOJu0YxFNb5r6h4eDHJIc4Nmdz2q/612PeU+Qdn6ZZa7eJ3CS/wSco6j LdpuMQsi326kj8gzD+th6ND7uektuedUamTDjXUdXbyOTKqNGzV7mCmcPFNYliCkK2tY7H1H122 oiA3A2g== X-Google-Smtp-Source: AGHT+IFVJDgCTenglKzN+2P2n74tj1SDxYiiOgRXQXQ9AKriir6033Iaqd41zDjHfck3wKQ7VyjbSQ== X-Received: by 2002:a05:6a00:4607:b0:718:da06:a4bf with SMTP id d2e1a72fcca58-71de23a5c08mr23942723b3a.2.1728402203348; Tue, 08 Oct 2024 08:43:23 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71df0ccf01dsm6293527b3a.70.2024.10.08.08.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 08:43:23 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , arkadiuszx.kusztal@intel.com, Kai Ji , Ciara Power Subject: [PATCH v8 13/17] common/qat: fix use after free Date: Tue, 8 Oct 2024 08:41:43 -0700 Message-ID: <20241008154301.66192-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241008154301.66192-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241008154301.66192-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