提交 a782c54f 编写于 作者: D Dmitry Osipenko 提交者: Zheng Zengkai

drm/panfrost: Put mapping instead of shmem obj on panfrost_mmu_map_fault_addr() error

stable inclusion
from stable-v5.10.132
commit 2e760fe05d3ea5b5addb02691ec8a29e601dff56
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5YS3T

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2e760fe05d3ea5b5addb02691ec8a29e601dff56

--------------------------------

commit fb6e0637 upstream.

When panfrost_mmu_map_fault_addr() fails, the BO's mapping should be
unreferenced and not the shmem object which backs the mapping.

Cc: stable@vger.kernel.org
Fixes: bdefca2d ("drm/panfrost: Add the panfrost_gem_mapping concept")
Reviewed-by: NSteven Price <steven.price@arm.com>
Signed-off-by: NDmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: NSteven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220630200601.1884120-2-dmitry.osipenko@collabora.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 7b2694c5
......@@ -484,7 +484,7 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as,
err_pages:
drm_gem_shmem_put_pages(&bo->base);
err_bo:
drm_gem_object_put(&bo->base.base);
panfrost_gem_mapping_put(bomapping);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册