drm/mediatek: Fix potential memory leak if vmap() fail
authorSui Jingfeng <suijingfeng@loongson.cn>
Thu, 6 Jul 2023 13:40:00 +0000 (21:40 +0800)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Sun, 13 Aug 2023 14:26:13 +0000 (14:26 +0000)
commit379091e0f6d179d1a084c65de90fa44583b14a70
treebf5cddd9f58c8fa720e154eb53f00f380141adfd
parented6adfb7d4b5cb912c763f87dfedc1d41d3c4a49
drm/mediatek: Fix potential memory leak if vmap() fail

Also return -ENOMEM if such a failure happens, the implement should take
responsibility for the error handling.

Fixes: 3df64d7b0a4f ("drm/mediatek: Implement gem prime vmap/vunmap function")
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20230706134000.130098-1-suijingfeng@loongson.cn/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_drm_gem.c