diff mbox series

drm/etnaviv: NULL vs IS_ERR() buf in etnaviv_core_dump()

Message ID 20190114104946.GA22444@kadam (mailing list archive)
State New, archived
Headers show
Series drm/etnaviv: NULL vs IS_ERR() buf in etnaviv_core_dump() | expand

Commit Message

Dan Carpenter Jan. 14, 2019, 10:49 a.m. UTC
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>
---
 drivers/gpu/drm/etnaviv/etnaviv_dump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lucas Stach Jan. 16, 2019, 3:31 p.m. UTC | #1
Am Montag, den 14.01.2019, 13:49 +0300 schrieb Dan Carpenter:
> 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>

Thanks, applied to etnaviv/next.

> ---
>  drivers/gpu/drm/etnaviv/etnaviv_dump.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_dump.c
> b/drivers/gpu/drm/etnaviv/etnaviv_dump.c
> index 3fbb4855396c..33854c94cb85 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_dump.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_dump.c
> @@ -215,7 +215,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;
diff mbox series

Patch

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_dump.c b/drivers/gpu/drm/etnaviv/etnaviv_dump.c
index 3fbb4855396c..33854c94cb85 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_dump.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_dump.c
@@ -215,7 +215,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;