drm/etnaviv: NULL vs IS_ERR() buf in etnaviv_core_dump()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 14 Jan 2019 10:49:46 +0000 (13:49 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jan 2020 09:24:11 +0000 (10:24 +0100)
[ Upstream commit f8261c376e7f8cb9024af5a6c54be540c7f9108e ]

The etnaviv_gem_get_pages() never returns NULL.  It returns error
pointers on error.

Fixes: a8c21a5451d8 ("drm/etnaviv: add initial etnaviv DRM driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/etnaviv/etnaviv_dump.c

index 2bef501d4a17211069a9c9dfdad233a44d2d0611..5af7c2594a79ece3b18f7da4fdae9862c3917eb9 100644 (file)
@@ -206,7 +206,7 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
                mutex_lock(&obj->lock);
                pages = etnaviv_gem_get_pages(obj);
                mutex_unlock(&obj->lock);
-               if (pages) {
+               if (!IS_ERR(pages)) {
                        int j;
 
                        iter.hdr->data[0] = bomap - bomap_start;