From patchwork Mon Jul 4 15:27:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Laatz X-Patchwork-Id: 113660 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 72011A0540; Mon, 4 Jul 2022 17:27:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E99DC410F6; Mon, 4 Jul 2022 17:27:38 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id D5D1840E09 for ; Mon, 4 Jul 2022 17:27:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656948457; x=1688484457; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kYpaWCv5oOe9ObBy7S2Miojy9P5Kpy7j/ZzWWd39fhU=; b=YdP3ZeK+wa+OQ7leTmkt5vpyvvw634J/Ho5SrVdxvKm76pA3UKnYCGGG CuNcZLbGiklSsXktXWcTaUeCtr0pOr3deVWjvDw6DuxyMofKRA1r/r80a iOxFC1yZ77Rkg+In1lTALMh7DqYNTgLGiu1/hgS+QQrYD+ml8zg3piHT7 K4C0ceUuqzddUpYQ2HvHEaxK2YrPZqjWIFOMV619ETfeRDvEUZWRJYUCY veOWOt8xiV8+bY/rzbNMx1VDSCvMz7s1R1BWIDQB4D5uap3dyGc8R7uSG iTPpX/KixlC/Cf7Q3cDRV4Ytq+YALwukaJrUKbiAb48eDFPA8AzZ3MLfn w==; X-IronPort-AV: E=McAfee;i="6400,9594,10398"; a="262946833" X-IronPort-AV: E=Sophos;i="5.92,243,1650956400"; d="scan'208";a="262946833" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2022 08:27:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,243,1650956400"; d="scan'208";a="682230996" Received: from silpixa00401122.ir.intel.com ([10.237.213.29]) by FMSMGA003.fm.intel.com with ESMTP; 04 Jul 2022 08:27:08 -0700 From: Kevin Laatz To: dev@dpdk.org Cc: bruce.richardson@intel.com, Kevin Laatz Subject: [PATCH v3 0/3] Fix IDXD PCI device close Date: Mon, 4 Jul 2022 16:27:48 +0100 Message-Id: <20220704152751.943965-1-kevin.laatz@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220408141504.1319913-1-kevin.laatz@intel.com> References: <20220408141504.1319913-1-kevin.laatz@intel.com> MIME-Version: 1.0 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 This patchset addresses the device close for IDXD PCI devices. Initially, there was a memory leak reported by ASAN for the 'pci' member of the 'idxd_dmadev' struct due to a missing free. In addition, this patch set corrects the behaviour of the device close function to ensure the cleanup is completed correctly. Depends-on: patch-112376 ("eal: add device removal in rte cleanup") --- v3: * move ref_count increment from common create to pci probe * improve commit messages v2: * remove changes to applications (no longer needed with EAL changes) * add fix for NULL pointer dereference in pci remove Kevin Laatz (3): dma/idxd: fix memory leak in pci close dma/idxd: fix memory leak due to free on incorrect pointer dma/idxd: fix null pointer dereference during pci remove drivers/dma/idxd/idxd_internal.h | 2 ++ drivers/dma/idxd/idxd_pci.c | 45 +++++++++++++++++++++++--------- 2 files changed, 35 insertions(+), 12 deletions(-)