Marcin Slusarz
2010-Aug-23 20:40 UTC
[Nouveau] [mesa PATCH] nouveau: handle early initialization errors
handle very early errors in pipe_screen creation (failure of nouveau_screen_init in nv50_screen_create) --- src/gallium/drivers/nouveau/nouveau_screen.c | 3 ++- .../winsys/nouveau/drm/nouveau_drm_winsys.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c index 513e5e0..ebb21a6 100644 --- a/src/gallium/drivers/nouveau/nouveau_screen.c +++ b/src/gallium/drivers/nouveau/nouveau_screen.c @@ -258,6 +258,7 @@ nouveau_screen_fini(struct nouveau_screen *screen) { struct pipe_winsys *ws = screen->base.winsys; nouveau_channel_free(&screen->channel); - ws->destroy(ws); + if (ws) + ws->destroy(ws); } diff --git a/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c b/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c index 660dbd0..d4bf124 100644 --- a/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c +++ b/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c @@ -19,7 +19,8 @@ nouveau_drm_destroy_winsys(struct pipe_winsys *s) { struct nouveau_winsys *nv_winsys = nouveau_winsys(s); struct nouveau_screen *nv_screen= nouveau_screen(nv_winsys->pscreen); - nouveau_device_close(&nv_screen->device); + if (nv_screen) + nouveau_device_close(&nv_screen->device); FREE(nv_winsys); } -- 1.7.1.1
Francisco Jerez
2010-Aug-25 22:36 UTC
[Nouveau] [mesa PATCH] nouveau: handle early initialization errors
Marcin Slusarz <marcin.slusarz at gmail.com> writes:> handle very early errors in pipe_screen creation (failure of > nouveau_screen_init in nv50_screen_create) > --- > src/gallium/drivers/nouveau/nouveau_screen.c | 3 ++- > .../winsys/nouveau/drm/nouveau_drm_winsys.c | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c > index 513e5e0..ebb21a6 100644 > --- a/src/gallium/drivers/nouveau/nouveau_screen.c > +++ b/src/gallium/drivers/nouveau/nouveau_screen.c > @@ -258,6 +258,7 @@ nouveau_screen_fini(struct nouveau_screen *screen) > { > struct pipe_winsys *ws = screen->base.winsys; > nouveau_channel_free(&screen->channel); > - ws->destroy(ws); > + if (ws) > + ws->destroy(ws); > } > > diff --git a/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c b/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c > index 660dbd0..d4bf124 100644 > --- a/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c > +++ b/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c > @@ -19,7 +19,8 @@ nouveau_drm_destroy_winsys(struct pipe_winsys *s) > { > struct nouveau_winsys *nv_winsys = nouveau_winsys(s); > struct nouveau_screen *nv_screen= nouveau_screen(nv_winsys->pscreen); > - nouveau_device_close(&nv_screen->device); > + if (nv_screen) > + nouveau_device_close(&nv_screen->device); > FREE(nv_winsys); > }Thanks, pushed. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 229 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/nouveau/attachments/20100826/93f69607/attachment.pgp>