]> git.itanic.dy.fi Git - linux-stable/commit
drm/panfrost: Fix the error path in panfrost_mmu_map_fault_addr()
authorBoris Brezillon <boris.brezillon@collabora.com>
Fri, 5 Jan 2024 18:46:11 +0000 (21:46 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Apr 2024 09:23:37 +0000 (11:23 +0200)
commite18070c622c63f0cab170348e320454728c277aa
tree2bb76729676f49bfa09fc8b7aa1357998d91bd71
parent35768baf0fdfc47ede42d899506bad78450e9294
drm/panfrost: Fix the error path in panfrost_mmu_map_fault_addr()

commit 1fc9af813b25e146d3607669247d0f970f5a87c3 upstream.

Subject: drm/panfrost: Fix the error path in panfrost_mmu_map_fault_addr()

If some the pages or sgt allocation failed, we shouldn't release the
pages ref we got earlier, otherwise we will end up with unbalanced
get/put_pages() calls. We should instead leave everything in place
and let the BO release function deal with extra cleanup when the object
is destroyed, or let the fault handler try again next time it's called.

Fixes: 187d2929206e ("drm/panfrost: Add support for GPU heap allocations")
Cc: <stable@vger.kernel.org>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Co-developed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240105184624.508603-18-dmitry.osipenko@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/panfrost/panfrost_mmu.c