From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 6B9682B8C; Sun, 28 Oct 2018 03:19:46 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Oct 2018 19:19:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,434,1534834800"; d="scan'208";a="103860071" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.212]) by orsmga002.jf.intel.com with ESMTP; 27 Oct 2018 19:19:43 -0700 From: Ferruh Yigit To: Ravi Kumar Cc: dev@dpdk.org, Ferruh Yigit , stable@dpdk.org Date: Sun, 28 Oct 2018 03:19:27 +0000 Message-Id: <20181028031928.46445-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.17.2 Subject: [dpdk-dev] [PATCH] crypto/ccp: fix resource leak X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2018 02:19:47 -0000 File *fp, opened but not closed, this patch add fclose(fp) Fixes: ef4b04f87fa6 ("crypto/ccp: support device init") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit --- drivers/crypto/ccp/ccp_pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/ccp/ccp_pci.c b/drivers/crypto/ccp/ccp_pci.c index 59152ca5d..1702a09c4 100644 --- a/drivers/crypto/ccp/ccp_pci.c +++ b/drivers/crypto/ccp/ccp_pci.c @@ -31,12 +31,15 @@ ccp_check_pci_uio_module(void) while (uio_module_names[i] != NULL) { while (fgets(buf, sizeof(buf), fp) != NULL) { if (!strncmp(buf, uio_module_names[i], - strlen(uio_module_names[i]))) + strlen(uio_module_names[i]))) { + fclose(fp); return i; + } } i++; rewind(fp); } + fclose(fp); printf("Insert igb_uio or uio_pci_generic kernel module(s)"); return -1;/* uio not inserted */ } -- 2.17.2