summaryrefslogtreecommitdiff
path: root/drivers/bus/fslmc
diff options
context:
space:
mode:
authorHemant Agrawal <hemant.agrawal@nxp.com>2018-01-15 10:41:26 +0530
committerThomas Monjalon <thomas@monjalon.net>2018-01-17 00:44:47 +0100
commit5329b95aae3a22aaadc6888ae17c7082996abb97 (patch)
tree292543dd212c41c79e37ab09dcf443d631dafe8f /drivers/bus/fslmc
parentc564a2a20093e5146351bc8fb29024b44494832e (diff)
downloaddpdk-5329b95aae3a22aaadc6888ae17c7082996abb97.zip
dpdk-5329b95aae3a22aaadc6888ae17c7082996abb97.tar.gz
dpdk-5329b95aae3a22aaadc6888ae17c7082996abb97.tar.xz
bus/fslmc: clear the vfio group on error
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Diffstat (limited to 'drivers/bus/fslmc')
-rw-r--r--drivers/bus/fslmc/fslmc_vfio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 79ce9be..9f28fa0 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -637,12 +637,14 @@ fslmc_vfio_setup_group(void)
if (ret) {
FSLMC_VFIO_LOG(ERR, "VFIO error getting group status");
close(vfio_group.fd);
+ rte_vfio_clear_group(vfio_group.fd);
return ret;
}
if (!(status.flags & VFIO_GROUP_FLAGS_VIABLE)) {
FSLMC_VFIO_LOG(ERR, "VFIO group not viable");
close(vfio_group.fd);
+ rte_vfio_clear_group(vfio_group.fd);
return -EPERM;
}
/* Since Group is VIABLE, Store the groupid */
@@ -657,6 +659,7 @@ fslmc_vfio_setup_group(void)
"Error connecting container with groupid %d",
groupid);
close(vfio_group.fd);
+ rte_vfio_clear_group(vfio_group.fd);
return ret;
}
}
@@ -667,6 +670,7 @@ fslmc_vfio_setup_group(void)
FSLMC_VFIO_LOG(ERR, "Error getting device %s fd from group %d",
g_container, vfio_group.groupid);
close(vfio_group.fd);
+ rte_vfio_clear_group(vfio_group.fd);
return ret;
}
container_device_fd = ret;