mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
nouveau: fix potential double-free in nouveau_drm_screen_create
Fixes: 821f4c8d99 ("nouveau: import libdrm_nouveau")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29000>
This commit is contained in:
parent
3e2df67874
commit
d163498dbe
1 changed files with 2 additions and 2 deletions
|
|
@ -65,11 +65,11 @@ nouveau_drm_new(int fd, struct nouveau_drm **pdrm)
|
|||
if (!drm)
|
||||
return -ENOMEM;
|
||||
drm->fd = fd;
|
||||
*pdrm = drm;
|
||||
|
||||
drmVersionPtr ver = drmGetVersion(fd);
|
||||
if (!ver)
|
||||
goto out_err;
|
||||
*pdrm = drm;
|
||||
|
||||
drm->version = (ver->version_major << 24) |
|
||||
(ver->version_minor << 8) |
|
||||
|
|
@ -81,7 +81,7 @@ nouveau_drm_new(int fd, struct nouveau_drm **pdrm)
|
|||
return 0;
|
||||
|
||||
out_err:
|
||||
nouveau_drm_del(&drm);
|
||||
nouveau_drm_del(pdrm);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue