Previously, ver was unitialized on this path, causing UB on the
`if (ver)` branch after the out_err label.
Signed-off-by: Benjamin Lee <benjamin@computer.surgery>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
const char *path = drm_device->nodes[DRM_NODE_RENDER];
struct nouveau_ws_device *device = CALLOC_STRUCT(nouveau_ws_device);
uint64_t value = 0;
+ drmVersionPtr ver = NULL;
int fd = open(path, O_RDWR | O_CLOEXEC);
if (fd < 0)
goto out_err;
- drmVersionPtr ver = drmGetVersion(fd);
+ ver = drmGetVersion(fd);
if (!ver)
goto out_err;