patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [dpdk-dev] [PATCH] crypto/ccp: fix fd leak on probe failure
@ 2020-04-26  6:36 wangyunjian
  2020-04-27  4:10 ` Kumar, Ravi1
  0 siblings, 1 reply; 3+ messages in thread
From: wangyunjian @ 2020-04-26  6:36 UTC (permalink / raw)
  To: dev, ravi1.kumar; +Cc: jerry.lilijun, xudingke, Yunjian Wang, stable

From: Yunjian Wang <wangyunjian@huawei.com>

Zero is a valid fd. When ccp_probe_device() is failed, the uio_fd won't be
closed thus leading fd leak.

Fixes: ef4b04f87fa6 ("crypto/ccp: support device init")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/crypto/ccp/ccp_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/ccp/ccp_dev.c b/drivers/crypto/ccp/ccp_dev.c
index 80fe6a453..7d98b2eb2 100644
--- a/drivers/crypto/ccp/ccp_dev.c
+++ b/drivers/crypto/ccp/ccp_dev.c
@@ -760,7 +760,7 @@ ccp_probe_device(const char *dirname, uint16_t domain,
 	return 0;
 fail:
 	CCP_LOG_ERR("CCP Device probe failed");
-	if (uio_fd > 0)
+	if (uio_fd >= 0)
 		close(uio_fd);
 	if (ccp_dev)
 		rte_free(ccp_dev);
-- 
2.19.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] crypto/ccp: fix fd leak on probe failure
  2020-04-26  6:36 [dpdk-stable] [dpdk-dev] [PATCH] crypto/ccp: fix fd leak on probe failure wangyunjian
@ 2020-04-27  4:10 ` Kumar, Ravi1
  2020-05-09 21:52   ` Akhil Goyal
  0 siblings, 1 reply; 3+ messages in thread
From: Kumar, Ravi1 @ 2020-04-27  4:10 UTC (permalink / raw)
  To: wangyunjian, dev; +Cc: jerry.lilijun, xudingke, stable

[AMD Public Use]

Acked-by: Ravi Kumar <ravi1.kumar@amd.com>
>-----Original Message-----
>From: wangyunjian <wangyunjian@huawei.com> 
>Sent: Sunday, April 26, 2020 12:06 PM
>To: dev@dpdk.org; Kumar, Ravi1 <Ravi1.Kumar@amd.com>
>Cc: jerry.lilijun@huawei.com; xudingke@huawei.com; Yunjian Wang <wangyunjian@huawei.com>; stable@dpdk.org
>Subject: [dpdk-dev] [PATCH] crypto/ccp: fix fd leak on probe failure
>
>
>From: Yunjian Wang <wangyunjian@huawei.com>
>
>Zero is a valid fd. When ccp_probe_device() is failed, the uio_fd won't be closed thus leading fd leak.
>
>Fixes: ef4b04f87fa6 ("crypto/ccp: support device init")
>Cc: stable@dpdk.org
>
>Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
>---
> drivers/crypto/ccp/ccp_dev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/crypto/ccp/ccp_dev.c b/drivers/crypto/ccp/ccp_dev.c index 80fe6a453..7d98b2eb2 100644
>--- a/drivers/crypto/ccp/ccp_dev.c
>+++ b/drivers/crypto/ccp/ccp_dev.c
>@@ -760,7 +760,7 @@ ccp_probe_device(const char *dirname, uint16_t domain,
>        return 0;
> fail:
>        CCP_LOG_ERR("CCP Device probe failed");
>-       if (uio_fd > 0)
>+       if (uio_fd >= 0)
>                close(uio_fd);
>        if (ccp_dev)
>                rte_free(ccp_dev);
>--
>2.19.1
>
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] crypto/ccp: fix fd leak on probe failure
  2020-04-27  4:10 ` Kumar, Ravi1
@ 2020-05-09 21:52   ` Akhil Goyal
  0 siblings, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2020-05-09 21:52 UTC (permalink / raw)
  To: Kumar, Ravi1, wangyunjian, dev; +Cc: jerry.lilijun, xudingke, stable



> 
> Acked-by: Ravi Kumar <ravi1.kumar@amd.com>
Applied to dpdk-next-crypto

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-09 21:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-26  6:36 [dpdk-stable] [dpdk-dev] [PATCH] crypto/ccp: fix fd leak on probe failure wangyunjian
2020-04-27  4:10 ` Kumar, Ravi1
2020-05-09 21:52   ` 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).