From: Dmitry Eremin-Solenikov Date: Tue, 25 Sep 2012 06:31:40 +0000 (+0400) Subject: drm/nouveau: fix pm initialization order X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d89c8ce07168ef6cd16c71d0a9f618829e866e87;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git drm/nouveau: fix pm initialization order If nouveau_pm_perflvl_get() fails, pm->profiles list will be left uninitialized, which causes oops during nouveau_pm_fini(). Move INIT_LIST_HEAD before call to nouveau_pm_perflvl_get(). Signed-off-by: Dmitry Eremin-Solenikov Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c index 3c55ec2366d3..d2f2de67f688 100644 --- a/drivers/gpu/drm/nouveau/nouveau_pm.c +++ b/drivers/gpu/drm/nouveau/nouveau_pm.c @@ -916,6 +916,8 @@ nouveau_pm_init(struct drm_device *dev) nouveau_volt_init(dev); nouveau_temp_init(dev); + INIT_LIST_HEAD(&pm->profiles); + /* determine current ("boot") performance level */ ret = nouveau_pm_perflvl_get(dev, &pm->boot); if (ret) { @@ -927,7 +929,6 @@ nouveau_pm_init(struct drm_device *dev) strncpy(pm->boot.profile.name, "boot", 4); pm->boot.profile.func = &nouveau_pm_static_profile_func; - INIT_LIST_HEAD(&pm->profiles); list_add(&pm->boot.profile.head, &pm->profiles); pm->profile_ac = &pm->boot.profile;