malidp: Fix NULL vs IS_ERR() checking
authorMiaoqian Lin <linmq006@gmail.com>
Mon, 13 Dec 2021 07:21:15 +0000 (07:21 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:57:40 +0000 (13:57 +0100)
commit 15342f930ebebcfe36f2415049736a77d7d2e045 upstream.

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/
Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/arm/malidp_planes.c

index 8c2ab3d653b705f632d29e8e13a94d803d82688a..f67c816050f2245a5f4b795d04acc980e3d18b40 100644 (file)
@@ -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;