From patchwork Sun Jul 3 12:22:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Laatz X-Patchwork-Id: 113652 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 7E25AA04FD; Sun, 3 Jul 2022 14:22:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 222F940E50; Sun, 3 Jul 2022 14:22:11 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 37CF640685 for ; Sun, 3 Jul 2022 14:22:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656850929; x=1688386929; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nrUa0H9mv8klPAcwkNbog0c8vOLzvPBuhNwFnln7MNw=; b=nqRlw+tDybeUW7xewWqnG59orXSeRyVjMfGHSn9ojXWgEnyqBtZgwgeS bErMHM56B2o7xDfW3Pa/D/FYos/5WKjYpB3UOqWEUckoLM0kDWs32VUV8 Y4M+UldZRlY23iShmkTkCQKI2vAoXPfzH2qRO5WfSG/jzuMqWaqHdPa2q +7jM2kwZfEdlmCavkL7atPmnnGXBOJ08POgiZ+L3/RK/4Cc4gOITbz10y zdor5CO2aQUKovgaDu4zZt4G5V2aEZTgOruIyD4BnKzs1ooromPzwQ2wX Vq/HL3i0ErrTJbg4dNxTetrYJLuz5QR//IHBYdZw7XdGqjsqqu7Qj3kwF w==; X-IronPort-AV: E=McAfee;i="6400,9594,10396"; a="262737106" X-IronPort-AV: E=Sophos;i="5.92,241,1650956400"; d="scan'208";a="262737106" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2022 05:22:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,241,1650956400"; d="scan'208";a="618931229" Received: from silpixa00401122.ir.intel.com ([10.237.213.29]) by orsmga008.jf.intel.com with ESMTP; 03 Jul 2022 05:22:07 -0700 From: Kevin Laatz To: dev@dpdk.org Cc: bruce.richardson@intel.com, Kevin Laatz Subject: [PATCH v2 0/3] Fix IDXD PCI device close Date: Sun, 3 Jul 2022 13:22:40 +0100 Message-Id: <20220703122243.929642-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") --- 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_common.c | 2 ++ drivers/dma/idxd/idxd_internal.h | 2 ++ drivers/dma/idxd/idxd_pci.c | 44 +++++++++++++++++++++++--------- 3 files changed, 36 insertions(+), 12 deletions(-)