[AMD Public Use]

Acked-by: Ravi Kumar <[email protected]>
>-----Original Message-----
>From: wangyunjian <[email protected]> 
>Sent: Sunday, April 26, 2020 12:06 PM
>To: [email protected]; Kumar, Ravi1 <[email protected]>
>Cc: [email protected]; [email protected]; Yunjian Wang 
><[email protected]>; [email protected]
>Subject: [dpdk-dev] [PATCH] crypto/ccp: fix fd leak on probe failure
>
>
>From: Yunjian Wang <[email protected]>
>
>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: [email protected]
>
>Signed-off-by: Yunjian Wang <[email protected]>
>---
> 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
>
>
>

Reply via email to