From patchwork Wed Jun 15 03:27:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuya Mukawa X-Patchwork-Id: 13751 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 4AFD6ADD7; Wed, 15 Jun 2016 05:27:09 +0200 (CEST) Received: from mail-pf0-f171.google.com (mail-pf0-f171.google.com [209.85.192.171]) by dpdk.org (Postfix) with ESMTP id A273AADD7 for ; Wed, 15 Jun 2016 05:27:07 +0200 (CEST) Received: by mail-pf0-f171.google.com with SMTP id t190so3995597pfb.3 for ; Tue, 14 Jun 2016 20:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=1N+6chcD6v9/iW6a7HW0TJlpXVP0xtWAyDZVmKPSTCA=; b=GIi9jslIs/fsYul5YL7wmVQd9SNJn90QYdJsfdaAUnOMQKdIs5KEOi+mmsOfX9LEZQ pzHJPmcvSLcJIyF9wQrsf963BV1YZ7X0oYbxS8KjhJ7eXx9l7U9dApNLi12/RB0PsLU1 q4N99Q0juv2j8cgDzTNfjhpW1NSSvoLRKxEDr/yjgsluvWCxAlWuRr3uVQFtipyaAWar g0wwhz8KinjU3Yqs93mGZyR/NxrvX4kK84N8ylYBxAgY0ahdw/NQlRlL2vWpncS8yan+ MwPPY+BFgrXQ1DGB/r55XTpd4n2sCzU2mWntiKwCLOM0PL8b7rCQeb5BINcfXGthj00U im/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=1N+6chcD6v9/iW6a7HW0TJlpXVP0xtWAyDZVmKPSTCA=; b=cN2ZjKFlLNhY0JQfDEvDVOuaUSIs6jaETlNMYRffPKoF9h9z7Hk7f4c6AzgvATztgP kue8rLg93EK56UVeihM+J8+u4Y5UbVAyPNxA+KBBVUd75CAYNKuBmYdvCJ+OSG7CR5oc GXAb5uq7qQf6LrXWXCOreH5huZuPY4f+mKjsLxj655lx/llvgpSHooCMEPRkh60aG1v6 QZLKS/nNslPgSlYBrXjCdwTfRntEhU3NHaJzfCrzxg4ClS1ebS0DdHzD/k4zw/qC3wCm SPshZzMNhtGa4ekoBdmqMEtMAskuOKAeu4rsRnGdEkBkQ8bC0VHTFm8ymR31jM9KdIlt rtMA== X-Gm-Message-State: ALyK8tL1Xb8CmLnreT91Yv1V+G5GklwmVzIy+bDgoIvj6X6o78tYS/5FdzNIaHpkjD1OKA== X-Received: by 10.98.42.206 with SMTP id q197mr1332663pfq.108.1465961226940; Tue, 14 Jun 2016 20:27:06 -0700 (PDT) Received: from localhost.localdomain (napt.igel.co.jp. [219.106.231.132]) by smtp.gmail.com with ESMTPSA id y70sm48563104pff.25.2016.06.14.20.27.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Jun 2016 20:27:06 -0700 (PDT) From: Tetsuya Mukawa To: dev@dpdk.org Cc: david.marchand@6wind.com, john.mcnamara@intel.com, michalx.k.jastrzebski@intel.com, Tetsuya Mukawa Date: Wed, 15 Jun 2016 12:27:01 +0900 Message-Id: <1465961221-28357-1-git-send-email-mukawa@igel.co.jp> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] eal: Fix wrong resource release of pci_uio_unmap() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The 'path' member of mapped_pci_resource structure is allocated by primary process, but currenctly it will be freed by both primary and secondary process. The patch fixes to be freed by only primary process. Signed-off-by: Tetsuya Mukawa --- lib/librte_eal/common/eal_common_pci_uio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_pci_uio.c b/lib/librte_eal/common/eal_common_pci_uio.c index e718643..b2c68f3 100644 --- a/lib/librte_eal/common/eal_common_pci_uio.c +++ b/lib/librte_eal/common/eal_common_pci_uio.c @@ -162,7 +162,9 @@ pci_uio_unmap(struct mapped_pci_resource *uio_res) for (i = 0; i != uio_res->nb_maps; i++) { pci_unmap_resource(uio_res->maps[i].addr, (size_t)uio_res->maps[i].size); - rte_free(uio_res->maps[i].path); + + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + rte_free(uio_res->maps[i].path); } }