Skip to contentSkip to conversation

udmabuf: Fix NULL vs IS_ERR() checking

PATCH New Miaoqian Lin 1 participant 1 message Dec 13, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udmabuf: Fix NULL vs IS_ERR() checking

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

---
 drivers/gpu/drm/arm/malidp_planes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/arm/malidp_planes.c +1 -1
index 0562bdaac00c..2ef8feae8c4e 100644
@@ -348,7 +348,7 @@ static bool malidp_check_pages_threshold(struct malidp_plane_state *ms,
 		else
 			sgt = obj->funcs->get_sg_table(obj);
 
-		if (!sgt)
+		if (IS_ERR(sgt))
 			return false;
 
 		sgl = sgt->sgl;
Signature · 1 line
2.17.1