v3dv: check return value of drmGetMagic

Fixes coverty issue:

** CID 1470345: Error handling issues (CHECKED_RETURN)
/src/broadcom/vulkan/v3dv_device.c: 407 in v3dv_drm_handle_device()
Calling "drmGetMagic" without checking return value (as is done
elsewhere 5 out of 6 times).

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7828>
This commit is contained in:
Iago Toral Quiroga 2020-11-30 07:44:28 +01:00 committed by Marge Bot
parent 124ea8debf
commit b14679ab22
1 changed files with 4 additions and 1 deletions

View File

@ -404,7 +404,10 @@ v3dv_drm_handle_device(void *data, struct wl_drm *drm, const char *device)
info->is_set = info->fd != -1;
drm_magic_t magic;
drmGetMagic(info->fd, &magic);
if (drmGetMagic(info->fd, &magic)) {
fprintf(stderr, "drmGetMagic failed.");
return;
}
wl_drm_authenticate(info->wl_drm, magic);
}