diff options
author | Karol Herbst <kherbst@redhat.com> | 2017-11-06 10:20:33 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2017-12-18 19:16:37 -0500 |
commit | 34112bf4935dabe3c1d1fd42842ed771e279bf61 (patch) | |
tree | 7f772fba062804dd5de35cc332df8d282ad3f6b1 | |
parent | d34ded7ece57782e75bf31bb145836b9f280750f (diff) |
drm/nouveau/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@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_fbcon.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index c533d8e04afc..be7357bf2246 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c | |||
@@ -429,7 +429,7 @@ nouveau_fbcon_destroy(struct drm_device *dev, struct nouveau_fbdev *fbcon) | |||
429 | drm_fb_helper_unregister_fbi(&fbcon->helper); | 429 | drm_fb_helper_unregister_fbi(&fbcon->helper); |
430 | drm_fb_helper_fini(&fbcon->helper); | 430 | drm_fb_helper_fini(&fbcon->helper); |
431 | 431 | ||
432 | if (nouveau_fb->nvbo) { | 432 | if (nouveau_fb && nouveau_fb->nvbo) { |
433 | nouveau_vma_del(&nouveau_fb->vma); | 433 | nouveau_vma_del(&nouveau_fb->vma); |
434 | nouveau_bo_unmap(nouveau_fb->nvbo); | 434 | nouveau_bo_unmap(nouveau_fb->nvbo); |
435 | nouveau_bo_unpin(nouveau_fb->nvbo); | 435 | nouveau_bo_unpin(nouveau_fb->nvbo); |