From: Greg Kroah-Hartman Date: Sat, 7 Oct 2023 09:55:56 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.14.327~81 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=17194010110bcc08c4753f68a8a15fd3041a10b6;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: drm-mediatek-fix-backport-issue-in-mtk_drm_gem_prime_vmap.patch --- diff --git a/queue-5.10/drm-mediatek-fix-backport-issue-in-mtk_drm_gem_prime_vmap.patch b/queue-5.10/drm-mediatek-fix-backport-issue-in-mtk_drm_gem_prime_vmap.patch new file mode 100644 index 00000000000..56e942ec29d --- /dev/null +++ b/queue-5.10/drm-mediatek-fix-backport-issue-in-mtk_drm_gem_prime_vmap.patch @@ -0,0 +1,43 @@ +From nathan@kernel.org Sat Oct 7 11:52:29 2023 +From: Nathan Chancellor +Date: Fri, 22 Sep 2023 08:51:17 -0700 +Subject: drm/mediatek: Fix backport issue in mtk_drm_gem_prime_vmap() +To: Greg Kroah-Hartman , Sasha Levin +Cc: Chun-Kuang Hu , Philipp Zabel , linux-mediatek@lists.infradead.org, stable@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor +Message-ID: <20230922-5-10-fix-drm-mediatek-backport-v1-1-912d76cd4a96@kernel.org> + +From: Nathan Chancellor + +When building with clang: + + drivers/gpu/drm/mediatek/mtk_drm_gem.c:255:10: error: incompatible integer to pointer conversion returning 'int' from a function with result type 'void *' [-Wint-conversion] + 255 | return -ENOMEM; + | ^~~~~~~ + 1 error generated. + +GCC reports the same issue as a warning, rather than an error. + +Prior to commit 7e542ff8b463 ("drm/mediatek: Use struct dma_buf_map in +GEM vmap ops"), this function returned a pointer rather than an integer. +This function is indirectly called in drm_gem_vmap(), which treats NULL +as -ENOMEM through an error pointer. Return NULL in this block to +resolve the warning but keep the same end result. + +Fixes: 43f561e809aa ("drm/mediatek: Fix potential memory leak if vmap() fail") +Signed-off-by: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/mediatek/mtk_drm_gem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c ++++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c +@@ -252,7 +252,7 @@ void *mtk_drm_gem_prime_vmap(struct drm_ + if (!mtk_gem->kvaddr) { + kfree(sgt); + kfree(mtk_gem->pages); +- return -ENOMEM; ++ return NULL; + } + out: + kfree(sgt); diff --git a/queue-5.10/series b/queue-5.10/series index 3005b95a89e..85ca3f86eff 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -169,6 +169,7 @@ nfs-rename-nfs_client_kset-to-nfs_kset.patch nfsv4-fix-a-state-manager-thread-deadlock-regression.patch ring-buffer-remove-obsolete-comment-for-free_buffer_.patch ring-buffer-fix-bytes-info-in-per_cpu-buffer-stats.patch +drm-mediatek-fix-backport-issue-in-mtk_drm_gem_prime_vmap.patch rbd-move-rbd_dev_refresh-definition.patch rbd-decouple-header-read-in-from-updating-rbd_dev-he.patch rbd-decouple-parent-info-read-in-from-updating-rbd_d.patch