[Nouveau] null deref in nouveau_clock_init on pre-nv40 cards

Ilia Mirkin imirkin at alum.mit.edu
Thu Nov 14 00:38:32 PST 2013


Hi Ben,

Pre-nv40 cards don't have domains defined, which the
nouveau_clock_init code assumes exists. The following
(white-space-damaged, sorry) patch fixes boot for me, haven't really
tested the pre-nv40 cards in my system much further. I assume there's
some proper fix here.

  -ilia

diff --git a/drivers/gpu/drm/nouveau/core/subdev/clock/base.c
b/drivers/gpu/drm/nouveau/core/subdev/clock/base.c
index ce82dc4..acc4ac8 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/clock/base.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/clock/base.c
@@ -411,6 +411,7 @@ _nouveau_clock_init(struct nouveau_object *object)
        memset(&clk->bstate, 0x00, sizeof(clk->bstate));
        INIT_LIST_HEAD(&clk->bstate.list);
        clk->bstate.pstate = 0xff;
+       if (!clock) return 0;

        while (clock->name != nv_clk_src_max) {
                ret = clk->read(clk, clock->name);


More information about the Nouveau mailing list