crypto/ccp: fix fd leak on probe failure
Zero is a valid fd. When ccp_probe_device() is failed, the uio_fd won't be
closed thus leading fd leak.
Fixes: ef4b04f87f
("crypto/ccp: support device init")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Ravi Kumar <ravi1.kumar@amd.com>
This commit is contained in:
parent
1a805dee01
commit
4f429be4c0
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user