From: Ferruh Yigit Date: Sun, 28 Oct 2018 03:19:27 +0000 (+0000) Subject: crypto/ccp: fix resource leak X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5ef2566e0df8b36ae7cd91b6ef6adb4cdc3e7d99;p=dpdk.git crypto/ccp: fix resource leak 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 Reviewed-by: Ravi Kumar --- diff --git a/drivers/crypto/ccp/ccp_pci.c b/drivers/crypto/ccp/ccp_pci.c index 59152ca5d1..1702a09c4f 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 */ }