Karol Herbst
2017-Nov-06 15:20 UTC
[Nouveau] [PATCH] fbcon: fix NULL pointer access in nouveau_fbcon_destroy
When the fbcon object is initialized, but nouveau_fbcon_create is not called, we run into a NULL pointer access within nouveau_fbcon_create when unloading nouveau. The call to drm_fb_helper_funcs.fb_probe is deferred until there is a display for real since 4.14, that's why fbcon->helper.fb is still not set. Signed-off-by: Karol Herbst <kherbst at redhat.com> --- drm/nouveau/nouveau_fbcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drm/nouveau/nouveau_fbcon.c b/drm/nouveau/nouveau_fbcon.c index c533d8e0..be7357bf 100644 --- a/drm/nouveau/nouveau_fbcon.c +++ b/drm/nouveau/nouveau_fbcon.c @@ -429,7 +429,7 @@ nouveau_fbcon_destroy(struct drm_device *dev, struct nouveau_fbdev *fbcon) drm_fb_helper_unregister_fbi(&fbcon->helper); drm_fb_helper_fini(&fbcon->helper); - if (nouveau_fb->nvbo) { + if (nouveau_fb && nouveau_fb->nvbo) { nouveau_vma_del(&nouveau_fb->vma); nouveau_bo_unmap(nouveau_fb->nvbo); nouveau_bo_unpin(nouveau_fb->nvbo); -- 2.14.2
Seemingly Similar Threads
- [PATCH 4/4] drm/nouveau: Remove struct nouveau_framebuffer
- [PATCH 4/4] drm/nouveau: Remove struct nouveau_framebuffer
- [PATCH 2/4] drm/nouveau: Move struct nouveau_framebuffer.vma to struct nouveau_fbdev
- [PATCH 4/4] drm/nouveau: Remove struct nouveau_framebuffer
- [PATCH 4/4] drm/nouveau: Remove struct nouveau_framebuffer