mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +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> (cherry picked from commitd163498dbe)
This commit is contained in:
parent
27cf49205c
commit
02e295cb5c
2 changed files with 3 additions and 3 deletions
|
|
@ -84,7 +84,7 @@
|
|||
"description": "nouveau: fix potential double-free in nouveau_drm_screen_create",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "821f4c8d99a3068758db834a5c219082a9609b3c",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -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