提交 68d890a3 编写于 作者: M Michał Mirosław 提交者: Thierry Reding

drm/tegra: Fix NULL deref in debugfs/iova

When IOMMU is off, ->mm_lock is not initialized and ->mm is NULL.
Signed-off-by: NMichał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: NThierry Reding <treding@nvidia.com>
上级 7664b2fa
...@@ -1033,9 +1033,11 @@ static int tegra_debugfs_iova(struct seq_file *s, void *data) ...@@ -1033,9 +1033,11 @@ static int tegra_debugfs_iova(struct seq_file *s, void *data)
struct tegra_drm *tegra = drm->dev_private; struct tegra_drm *tegra = drm->dev_private;
struct drm_printer p = drm_seq_file_printer(s); struct drm_printer p = drm_seq_file_printer(s);
mutex_lock(&tegra->mm_lock); if (tegra->domain) {
drm_mm_print(&tegra->mm, &p); mutex_lock(&tegra->mm_lock);
mutex_unlock(&tegra->mm_lock); drm_mm_print(&tegra->mm, &p);
mutex_unlock(&tegra->mm_lock);
}
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册