DPDK patches and discussions
 help / color / mirror / Atom feed
* [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

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-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).