drm/nouveau/sw: fix oops if gpu has its display block disabled
authorBen Skeggs <bskeggs@redhat.com>
Tue, 26 Nov 2013 02:33:36 +0000 (12:33 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 3 Dec 2013 13:28:57 +0000 (23:28 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/engine/software/nv50.c

index b574dd4bb8285e65ccdbcf23db7b6f139e1cb73c..5ce686ee729ea5d937164d55892a9aebd2312b77 100644 (file)
@@ -176,7 +176,7 @@ nv50_software_context_ctor(struct nouveau_object *parent,
        if (ret)
                return ret;
 
-       chan->vblank.nr_event = pdisp->vblank->index_nr;
+       chan->vblank.nr_event = pdisp ? pdisp->vblank->index_nr : 0;
        chan->vblank.event = kzalloc(chan->vblank.nr_event *
                                     sizeof(*chan->vblank.event), GFP_KERNEL);
        if (!chan->vblank.event)