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 EB52A45A6D; Mon, 30 Sep 2024 20:47:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A3104014F; Mon, 30 Sep 2024 20:46:33 +0200 (CEST) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by mails.dpdk.org (Postfix) with ESMTP id 287B640695 for ; Mon, 30 Sep 2024 20:46:22 +0200 (CEST) Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-7d4f85766f0so3997220a12.2 for ; Mon, 30 Sep 2024 11:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727721981; x=1728326781; 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=S8QcYBwytbUkBgwmnVQoKhWOuuiVKR5qtzr7gvvfXxU4Rcq0CkDz+bDilGG/L8W6Sb ES2ogBVAcswz6oawi4ZAooLccPqUioc+488aOS7kFdZX1HkD0hCrptFXNkNX889gup3R xklKXKAUblIK3rbwgxXHTAQVh9u1oe1OwZTNmPJ5kmnwZp8XTZ+iaROn76vVIp+WtybJ 6MtMSGzUeUch28qOLvd40uJU0pBYTP58lHQmD2ZZ9NmwG/qS0WasydeNPkC9TzIgSZdS i8I0++YUc7kWWMKErxolqIhda2THBH2J2ug+v2ms98403AaYJC+yDuIuQsq+UY4/GG6z LA5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727721981; x=1728326781; 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=kjPkej6YimRXRBke3+OVjKcefFH/Fz+QmP4A3Pkb3GM8DWMeCl2I/Ijca3x1RXSiiu sOnTe6gjHrPY678V78N2h4odCkdNnZvLhaprW039VqBT6CEvilq6C+nhKoIbZWq0o3Fi IbhStBefr/tFVPSuI4vR66UtLMSvX+I51m7hV29xdS5exNOul6gVtHOCvDN/z/+Ffiff GHJs5P+FcRkNmOgYS3QD4Pfi0MRUR42wuTQRwb2hW3xneIyYN+5sma+R7Cj2doFd3Zg4 BhQIHp4JmI9tMrQdEDGzlzz8P+trJ90ZubRuwycrroImgB8EoR9A9BnC5BPy74nsaO+b RDKw== X-Gm-Message-State: AOJu0Yw//XcYf2l5nXmJ6YE8CcDhCnNAIVO5nhp1ru2/h8s9MoqDPTnD i3oD1b3PXgP051OL/XL1lC9G10iWLj0HkVFb572XeIdGdsj3HDtp8vumWGSuZTJLYhuHGAZt4Ul Yce3T3g== X-Google-Smtp-Source: AGHT+IHaMY7IF2MJTba1fAm5tRzbKbh+yfS5jUbNRFhJXUwctfnIDFKaweYvTJVOblNpPPjx8Ybi1A== X-Received: by 2002:a05:6a21:1643:b0:1ce:e080:185c with SMTP id adf61e73a8af0-1d4fa7b5700mr21541039637.41.1727721981299; Mon, 30 Sep 2024 11:46:21 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b264bcca6sm6581895b3a.78.2024.09.30.11.46.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 11:46:20 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , arkadiuszx.kusztal@intel.com, Kai Ji , Ciara Power Subject: [PATCH v4 13/17] common/qat: fix use after free Date: Mon, 30 Sep 2024 11:44:07 -0700 Message-ID: <20240930184600.7092-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240930184600.7092-1-stephen@networkplumber.org> References: <20240927204742.546164-1-stephen@networkplumber.org> <20240930184600.7092-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