From patchwork Thu May 6 11:19:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 93002 X-Patchwork-Delegate: thomas@monjalon.net 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 6AEB2A0524; Thu, 6 May 2021 13:19:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DEA67410DB; Thu, 6 May 2021 13:19:44 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 5125640040 for ; Thu, 6 May 2021 13:19:42 +0200 (CEST) IronPort-SDR: HYcY19E8MYOs6hWYM8y6FLQqHjLkF+Q0l2Muue2vu2kZtvrzTxx7G4EX7G8ka/VNs5AUkPDvGf 3YnVCqwpBhNg== X-IronPort-AV: E=McAfee;i="6200,9189,9975"; a="259724894" X-IronPort-AV: E=Sophos;i="5.82,277,1613462400"; d="scan'208";a="259724894" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2021 04:19:38 -0700 IronPort-SDR: jHNO7y4TnP9PnsLz7ITqS4/WbA037uB9SDeZ5FnisZY+54OF3y0SJshyzqTiM/zPaO+JwyfPa8 0xl1IAy9KrgQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,277,1613462400"; d="scan'208";a="430483508" Received: from silpixa00399126.ir.intel.com ([10.237.223.78]) by fmsmga008.fm.intel.com with ESMTP; 06 May 2021 04:19:37 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Thu, 6 May 2021 12:19:27 +0100 Message-Id: <20210506111927.787415-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] raw/ioat: fix resource leak for directory handle 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 Sender: "dev" When reading the /dev directory as part of the bus scan for DSA devices, the directory handle from opendir was not freed on function return, leading to a resource leak. Coverity issue: 370588 Fixes: b7aaf417f936 ("raw/ioat: add bus driver for device scanning automatically") Signed-off-by: Bruce Richardson --- drivers/raw/ioat/idxd_bus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/raw/ioat/idxd_bus.c b/drivers/raw/ioat/idxd_bus.c index 5b448d49de..5199786785 100644 --- a/drivers/raw/ioat/idxd_bus.c +++ b/drivers/raw/ioat/idxd_bus.c @@ -312,6 +312,7 @@ dsa_scan(void) dev->device.numa_node = numa_node; } + closedir(dev_dir); return 0; }