* [dpdk-dev] [PATCH] crypto/ccp: fix resource leak
@ 2018-10-28 3:19 Ferruh Yigit
2018-11-04 4:50 ` Kumar, Ravi1
0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2018-10-28 3:19 UTC (permalink / raw)
To: Ravi Kumar; +Cc: dev, Ferruh Yigit, stable
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/ccp: fix resource leak
2018-10-28 3:19 [dpdk-dev] [PATCH] crypto/ccp: fix resource leak Ferruh Yigit
@ 2018-11-04 4:50 ` Kumar, Ravi1
2018-11-12 12:49 ` Akhil Goyal
0 siblings, 1 reply; 3+ messages in thread
From: Kumar, Ravi1 @ 2018-11-04 4:50 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev, stable
>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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/ccp: fix resource leak
2018-11-04 4:50 ` Kumar, Ravi1
@ 2018-11-12 12:49 ` Akhil Goyal
0 siblings, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2018-11-12 12:49 UTC (permalink / raw)
To: Kumar, Ravi1, Ferruh Yigit; +Cc: dev, stable
On 11/4/2018 10:20 AM, Kumar, Ravi1 wrote:
>> 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
Added Reviewed-by from Ravi.
Applied to dpdk-next-crypto
Thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-12 12:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-28 3:19 [dpdk-dev] [PATCH] crypto/ccp: fix resource leak Ferruh Yigit
2018-11-04 4:50 ` Kumar, Ravi1
2018-11-12 12:49 ` Akhil Goyal
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).