DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Kumar, Ravi1" <Ravi1.Kumar@amd.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] crypto/ccp: fix resource leak
Date: Sun, 4 Nov 2018 04:50:53 +0000	[thread overview]
Message-ID: <SN1PR12MB2574633B58E5562CE89B70E9AEC90@SN1PR12MB2574.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20181028031928.46445-1-ferruh.yigit@intel.com>

>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 <ferruh.yigit@intel.com>
>---
> 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
>
Thanks Ferruh for the find. Looks good to me.

Regards,
Ravi

  reply	other threads:[~2018-11-04  4:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-28  3:19 Ferruh Yigit
2018-11-04  4:50 ` Kumar, Ravi1 [this message]
2018-11-12 12:49   ` Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SN1PR12MB2574633B58E5562CE89B70E9AEC90@SN1PR12MB2574.namprd12.prod.outlook.com \
    --to=ravi1.kumar@amd.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).