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 8623D45A8E; Wed, 2 Oct 2024 17:46:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C103540A75; Wed, 2 Oct 2024 17:44:58 +0200 (CEST) Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) by mails.dpdk.org (Postfix) with ESMTP id 3821D4067E for ; Wed, 2 Oct 2024 17:44:51 +0200 (CEST) Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-3e045525719so4243592b6e.2 for ; Wed, 02 Oct 2024 08:44:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727883890; x=1728488690; 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=zYkFzWKMTjs3MaunDzUKVLHNIYzoWXQ9S9IeYGOjBIB4KW//Z4Ug07o2uStVb2jLqL zmGDg19lz+E/h3J4WJ/Nnoo2+GHRcj4aS0UU1Pd+RBTxdoakxrjHiJJIdrLDG3ogOx89 ovewaI73SLtbJxalxkF0Q+MEGfSoPD4xpBF44F2DbX9n/thi5kFgx4iXQ3tH3WfL2fGX 627QtQsLr528yypqeQWhFkdcmQvlz1O9EZxl3YS6K3PU0BYOaHa8JW8XF697Zox68i44 aKEh+Gb/uC9K5XGpYeTKFvSOfFO2eiHR/CQ3+xjaXnYLzuzws1NcE5jJyJjO3jA3jeCX Otqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727883890; x=1728488690; 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=j5iBdFgpq+9Jrvu6noa1oxbI+xxCPaABc9k/nghspbRBqyBQg8m/0CqoZhcIqklPPw RXz55cHTYpP0jwn7uoK9juCTfpyogh7eHSvSEqBK4OG2M5B7xPASLen9Jx6GDIhvOXpP lcOAmvg1m/nWosK1ZaLX0ueR/kx6IP+eFhzpJyzzaz0tPwdYzo0Q1ViS4lIE9HS+3XgW hUKxD/GYFfNMPIb3PhAEBfGyk6OnVXTMHgHoPq1HbFY3U/aopDnh6fBDw2oV8K20qbi4 uXCKrfjTnVHcGyQcooWkDFNfDp43d8vvCfOybsibXSuq/iq3ThlUETp+2mShBg6bbr2u r3Xw== X-Gm-Message-State: AOJu0YyxRm00N7Nj21Q350F+wWBNavLwDHdtBzZTkv9BzBrIyY7Fp1O+ PeTITtDEm1Sjurqi4I1ZDfe7kj/Azkrmb6Sttoj7w54zG14sRL+u6f9D/zg4khM/xrngmjvObCE /RB0= X-Google-Smtp-Source: AGHT+IFCZbqbaS3gozeYcd1+/YBWrBCZldIP7qZJY4NZMPebq3kmBpzUoRHYS9Ehj+oEzfXjvzrWdw== X-Received: by 2002:a05:6808:16a3:b0:3e0:41fd:fcb4 with SMTP id 5614622812f47-3e3b40ffc83mr3443945b6e.15.1727883890495; Wed, 02 Oct 2024 08:44:50 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6db2927c7sm10247363a12.1.2024.10.02.08.44.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 08:44:50 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , arkadiuszx.kusztal@intel.com, Kai Ji , Ciara Power Subject: [PATCH v6 13/17] common/qat: fix use after free Date: Wed, 2 Oct 2024 08:42:57 -0700 Message-ID: <20241002154429.64357-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241002154429.64357-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20241002154429.64357-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