diff mbox series

[SRU,Focal,1/1] malidp: Fix NULL vs IS_ERR() checking

Message ID 20240215223644.89576-2-bethany.jamison@canonical.com
State New
Headers show
Series CVE-2023-23004 | expand

Commit Message

Bethany Jamison Feb. 15, 2024, 10:36 p.m. UTC
From: Miaoqian Lin <linmq006@gmail.com>

The get_sg_table() function does not return NULL.
It returns error pointers.

Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://lore.kernel.org/dri-devel/20211213072115.18098-1-linmq006@gmail.com/
(cherry picked from commit 15342f930ebebcfe36f2415049736a77d7d2e045)
CVE-2023-23004
Signed-off-by: Bethany Jamison <bethany.jamison@canonical.com>
---
 drivers/gpu/drm/arm/malidp_planes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index 7bf348d28fbf..77236926a0a4 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -348,7 +348,7 @@  static bool malidp_check_pages_threshold(struct malidp_plane_state *ms,
 		else
 			sgt = obj->dev->driver->gem_prime_get_sg_table(obj);
 
-		if (!sgt)
+		if (IS_ERR(sgt))
 			return false;
 
 		sgl = sgt->sgl;