vhost_iommu: handle opendir() failure

Change-Id: I82ce702ab1af83c2f5c0197a9766437f0f728dce
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/365067
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Daniel Verkamp 2017-06-12 13:46:54 -07:00 committed by Jim Harris
parent ff9c4b9a6e
commit dcb7abc717

View File

@ -91,6 +91,11 @@ vfio_cfg_init(void)
} }
dir = opendir("/proc/self/fd"); dir = opendir("/proc/self/fd");
if (!dir) {
SPDK_ERRLOG("Failed to open /proc/self/fd (%d)\n", errno);
return -1;
}
while ((d = readdir(dir)) != NULL) { while ((d = readdir(dir)) != NULL) {
if (d->d_type != DT_LNK) if (d->d_type != DT_LNK)
continue; continue;