Skip to content

Commit 3e8b3fb

Browse files
Mark Yaorkhuangtao
authored andcommitted
drm/rockchip: fix mm_dump NULL pointer crash
drm mm is not initial on non-iommu context. Fix crash: [ 11.635376] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [ 11.636148] pgd = ffffffc0de19d000 [ 11.636474] [00000000] *pgd=0000000000000000, *pud=0000000000000000 [ 11.637088] Internal error: Oops: 96000045 [#1] PREEMPT SMP [ 11.637594] Modules linked in: [ 11.637902] CPU: 4 PID: 424 Comm: sh Not tainted 4.4.71 torvalds#146 [ 11.638406] Hardware name: Rockchip RK3399 Evaluation Board v3 (Android) (DT) [ 11.639050] task: ffffffc0de796800 ti: ffffffc0de260000 task.ti: ffffffc0de260000 [ 11.639736] PC is at __mutex_lock_slowpath+0xa8/0x178 [ 11.640198] LR is at __mutex_lock_slowpath+0x7c/0x178 [ 11.788003] [<ffffff8008b85b5c>] __mutex_lock_slowpath+0xa8/0x178 [ 11.788560] [<ffffff8008b85c58>] mutex_lock+0x2c/0x44 [ 11.789024] [<ffffff800849e8d8>] rockchip_drm_mm_dump+0x30/0x5c [ 11.789560] [<ffffff80081d612c>] seq_read+0x1a8/0x3f8 [ 11.790017] [<ffffff80081b4208>] __vfs_read+0x38/0xf4 [ 11.790472] [<ffffff80081b4adc>] vfs_read+0x84/0x128 [ 11.790927] [<ffffff80081b552c>] SyS_read+0x54/0xa4 [ 11.791372] [<ffffff80080828b0>] el0_svc_naked+0x24/0x28 Change-Id: I342311da43d50b743257b81425dfc6a327306803 Signed-off-by: Mark Yao <[email protected]>
1 parent 411afb7 commit 3e8b3fb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/rockchip/rockchip_drm_drv.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,9 @@ static int rockchip_drm_mm_dump(struct seq_file *s, void *data)
896896
struct rockchip_drm_private *priv = drm_dev->dev_private;
897897
int ret;
898898

899+
if (!priv->domain)
900+
return 0;
901+
899902
mutex_lock(&priv->mm_lock);
900903

901904
ret = drm_mm_dump_table(s, &priv->mm);

0 commit comments

Comments
 (0)