提交 d89c8ce0 编写于 作者: D Dmitry Eremin-Solenikov 提交者: Ben Skeggs

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: NDmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 acac7bdb
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册