mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
nouveau: avoid leaking screen on initialization fail
Reported by Coverity Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
parent
b13a4ca3f7
commit
2e86432cc1
1 changed files with 5 additions and 2 deletions
|
|
@ -95,6 +95,8 @@ nouveau_init_screen2(__DRIscreen *dri_screen)
|
|||
if (!screen)
|
||||
return NULL;
|
||||
|
||||
dri_screen->driverPrivate = screen;
|
||||
|
||||
/* Open the DRM device. */
|
||||
ret = nouveau_device_wrap(dri_screen->fd, 0, &screen->device);
|
||||
if (ret) {
|
||||
|
|
@ -119,10 +121,11 @@ nouveau_init_screen2(__DRIscreen *dri_screen)
|
|||
dri_screen->max_gl_es1_version = 10;
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
nouveau_error("Unknown chipset: %02X\n",
|
||||
screen->device->chipset);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
dri_screen->driverPrivate = screen;
|
||||
dri_screen->extensions = nouveau_screen_extensions;
|
||||
screen->dri_screen = dri_screen;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue