Coverity ID 13289: Resource leak:
The system resource will not be reclaimed and reused,
reducing the future availability of the resource.
In pci_vfio_get_group_fd: Leak of memory or pointers to system resources
Fixes:
ff0b67d1c868 ("vfio: DMA mapping")
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
/* if the fd is valid, create a new group for it */
if (vfio_cfg.vfio_group_idx == VFIO_MAX_GROUPS) {
RTE_LOG(ERR, EAL, "Maximum number of VFIO groups reached!\n");
+ close(vfio_group_fd);
return -1;
}
vfio_cfg.vfio_groups[vfio_cfg.vfio_group_idx].group_no = iommu_group_no;