diff options
author | Boris Brezillon <boris.brezillon@collabora.com> | 2021-05-21 11:38:11 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-04-20 12:07:34 +0200 |
commit | c208b4321e8f3ea9cb9acc35dad2c87254f9b751 (patch) | |
tree | 174222c4dc690e9e35935d34230942fcc9a385d2 /drivers/gpu | |
parent | c381527918b1b03b67514ccd7864b4c1c5f10b40 (diff) | |
download | linux-stable-c208b4321e8f3ea9cb9acc35dad2c87254f9b751.tar.gz linux-stable-c208b4321e8f3ea9cb9acc35dad2c87254f9b751.tar.bz2 linux-stable-c208b4321e8f3ea9cb9acc35dad2c87254f9b751.zip |
drm/panfrost: Fix the panfrost_mmu_map_fault_addr() error path
commit 764a2ab9eb56e1200083e771aab16186836edf1d upstream.
Make sure all bo->base.pages entries are either NULL or pointing to a
valid page before calling drm_gem_shmem_put_pages().
Reported-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: <stable@vger.kernel.org>
Fixes: 187d2929206e ("drm/panfrost: Add support for GPU heap allocations")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210521093811.1018992-1-boris.brezillon@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/panfrost/panfrost_mmu.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index f1007c50565b..b17f3022db5a 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -502,6 +502,7 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as, if (IS_ERR(pages[i])) { mutex_unlock(&bo->base.pages_lock); ret = PTR_ERR(pages[i]); + pages[i] = NULL; goto err_pages; } } |