dril: Check for null config in dril_target.c

fixes: 06d417af

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33336>
(cherry picked from commit 4ecd183c56)
This commit is contained in:
Tim Keller 2025-01-31 19:36:54 -06:00 committed by Eric Engestrom
parent 66b260fb4f
commit 845a60dc35
2 changed files with 4 additions and 2 deletions

View file

@ -494,7 +494,7 @@
"description": "dril: Check for null config in dril_target.c",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "06d417af80bc1f171cadc338e63a7aa75c877754",
"notes": null

View file

@ -453,7 +453,9 @@ drilCreateNewScreen(int scrn, int fd,
const __DRIconfig ***driver_configs, void *data)
{
const __DRIconfig **configs = init_dri2_configs(fd);
if (!configs && fd == -1) {
if (!configs) {
if (fd != -1)
return NULL;
// otherwise set configs to point to our config list
configs = calloc(ARRAY_SIZE(drilConfigs) * 2 + 1, sizeof(void *));
int c = 0;