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 7ACC945A9F; Wed, 2 Oct 2024 20:40:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2EFB240A7D; Wed, 2 Oct 2024 20:39:50 +0200 (CEST) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by mails.dpdk.org (Postfix) with ESMTP id 467A740689 for ; Wed, 2 Oct 2024 20:39:40 +0200 (CEST) Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-718816be6cbso157290b3a.1 for ; Wed, 02 Oct 2024 11:39:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727894379; x=1728499179; 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=XdalRCThykdHXBoLCo5sen4gDfu/NY4w18wEZsdrNhxKGXLLUBDeISiTkXSc+OsNgZ ryfTucoByDloXvWK3a33kF9I22O66h04LexGZQpVw/xJW3LW9/rYZgxwHcSEZmhcJv4M PH6X9MiK8LrzGGBEJBBi2IIE992/gkOOAKnvcvZImcbnOX7BgYkqM2H7m98eEdhNZxmy Kb8rH4qgG2cB0r5iRV6nzeugh6iCUq5XFZ2wbE3UgNGNA2h1BVX8vKcBFSc+ssZPupqR zhc5QwyTwJf440CyPuSwnt0UD3F8SlRHVzCyjyqWlhSuEKArNWBb/Cho0oVSzPrW0A+o 9Imw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727894379; x=1728499179; 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=HScu/uB29gHjacZgn7WI9m7ky/I3JdhS+oerVB4Q5bMRv9LtKMkrukR0kllAA8xtNX PubEKvrGGH+4VG8CndnLQ9SBywJuvuRNhppdQ0eu/9AhQ2Swu3J3APSGHCDH9htIxPVU NxVMEbcaGX7FCfEYRghszdtkDJpbJL1B6wgyveCWkix2Vhmtd3rUVZTDxBl5yazFMuU/ 946A5T8q9stmT/ZbQBBShdvmCarvObq9NX45T6NV0GC8Rf4RR4KKgnJGMyfoGsO//YZJ rH1dgjsajdvOhImAvngQFoVuFUEOqqPB/PiJpqZQ7P0tLHRMvdpcuwGuc42UrUw4XV1g /lmw== X-Gm-Message-State: AOJu0Yy0AeLiYjeoUOMQ11M2qLvtNnGTMpf9OB/b4FdzqkKvKHYqwyw/ 4OqZ3LBkw4N5SE3ihLkB+fKazParlO6JbtHN0pb4ATZcxFS9QB3XBfGqU01A3FUR93y9EqQ0BZU D X-Google-Smtp-Source: AGHT+IH8wZODKMJRLGtc36vsbN3jvnmGBomayVXHf/t76L6KtYjXzy5oOPdmd2MHm77zJj5Sog/cAg== X-Received: by 2002:a05:6a00:3d51:b0:718:d573:25a7 with SMTP id d2e1a72fcca58-71dc5cb0a8cmr5911731b3a.13.1727894379386; Wed, 02 Oct 2024 11:39:39 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b2649b0bdsm10104362b3a.34.2024.10.02.11.39.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 11:39:38 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , arkadiuszx.kusztal@intel.com, Kai Ji , Ciara Power Subject: [PATCH v7 13/16] common/qat: fix use after free Date: Wed, 2 Oct 2024 11:37:51 -0700 Message-ID: <20241002183918.161656-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241002183918.161656-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241002183918.161656-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