zink: bail on choose_pdev immediately if no devices are available

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30746>
This commit is contained in:
Mike Blumenkrantz 2024-08-20 12:24:23 -04:00 committed by Marge Bot
parent 07e0834774
commit a442f67d2f

View File

@ -1717,7 +1717,8 @@ choose_pdev(struct zink_screen *screen, int64_t dev_major, int64_t dev_minor)
return;
}
assert(pdev_count > 0);
if (!pdev_count)
return;
pdevs = malloc(sizeof(*pdevs) * pdev_count);
if (!pdevs) {
@ -1753,6 +1754,8 @@ choose_pdev(struct zink_screen *screen, int64_t dev_major, int64_t dev_minor)
mesa_loge("ZINK: vkEnumeratePhysicalDevices failed (%s)", vk_Result_to_str(result));
return;
}
if (!pdev_count)
return;
screen->pdev = pdev;
}
VKSCR(GetPhysicalDeviceProperties)(screen->pdev, &screen->info.props);