drm/nouveau: fix for disabled fbdev emulation
authorDmitrii Tcvetkov <demfloro@demfloro.ru>
Mon, 20 Jun 2016 10:52:14 +0000 (13:52 +0300)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 23 Jun 2016 21:51:32 +0000 (07:51 +1000)
Hello,

after this commit:

commit f045f459d925138fe7d6193a8c86406bda7e49da
Author: Ben Skeggs <bskeggs@redhat.com>
Date:   Thu Jun 2 12:23:31 2016 +1000
    drm/nouveau/fbcon: fix out-of-bounds memory accesses

kernel started to oops when loading nouveau module when using GTX 780 Ti
video adapter. This patch fixes the problem.

Bug report: https://bugzilla.kernel.org/show_bug.cgi?id=120591

Signed-off-by: Dmitrii Tcvetkov <demfloro@demfloro.ru>
Suggested-by: Ilia Mirkin <imirkin@alum.mit.edu>
Fixes: f045f459d925 ("nouveau_fbcon_init()")
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/nouveau/nouveau_fbcon.c

index 300ea03be8f07aa71b45dbb6acbf599a01cbdccc..d1f248fd35061993db2529c4b93e557a4331e829 100644 (file)
@@ -552,7 +552,8 @@ nouveau_fbcon_init(struct drm_device *dev)
        if (ret)
                goto fini;
 
-       fbcon->helper.fbdev->pixmap.buf_align = 4;
+       if (fbcon->helper.fbdev)
+               fbcon->helper.fbdev->pixmap.buf_align = 4;
        return 0;
 
 fini: