v3dv: initialize fd variable for proper error handling

Currently, process_singlesync_signals() checks if fd == -1 to handle
possible errors in the drmSyncobjExportSyncFile function. But, fd is not
initialized, which means that drmSyncobjExportSyncFile might fail and
the error will not be handled as fd might not be equal to -1.

Therefore, initialize the fd variable with value -1 to ensure proper
error handling.

cc: mesa-stable

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20475>
This commit is contained in:
Maíra Canal 2022-12-31 10:44:18 -03:00 committed by Marge Bot
parent f4b4bc0c2f
commit a2252adde8

View file

@ -490,7 +490,7 @@ process_singlesync_signals(struct v3dv_queue *queue,
if (device->pdevice->caps.multisync)
return VK_SUCCESS;
int fd;
int fd = -1;
drmSyncobjExportSyncFile(device->pdevice->render_fd,
queue->last_job_syncs.syncs[V3DV_QUEUE_ANY],
&fd);