All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpu: drm: nouveau: add null check before pointer dereference
@ 2017-05-22 19:12 Gustavo A. R. Silva
  2017-05-22 22:24   ` Ben Skeggs
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2017-05-22 19:12 UTC (permalink / raw)
  To: Ben Skeggs, David Airlie
  Cc: dri-devel, nouveau, linux-kernel, Gustavo A. R. Silva

Add null check before dereferencing pointer asyc

Addresses-Coverity-ID: 1397932
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/gpu/drm/nouveau/nv50_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index a766324..052a60a 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -2107,7 +2107,8 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state)
 					asyc->set.dither = true;
 			}
 		} else {
-			asyc->set.mask = ~0;
+			if (asyc)
+				asyc->set.mask = ~0;
 			asyh->set.mask = ~0;
 		}
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpu: drm: nouveau: add null check before pointer dereference
  2017-05-22 19:12 [PATCH] gpu: drm: nouveau: add null check before pointer dereference Gustavo A. R. Silva
@ 2017-05-22 22:24   ` Ben Skeggs
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Skeggs @ 2017-05-22 22:24 UTC (permalink / raw)
  To: Gustavo A. R. Silva, David Airlie
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 05/23/2017 05:12 AM, Gustavo A. R. Silva wrote:
> Add null check before dereferencing pointer asyc
I've taken the patch into my tree, thanks!

Ben.

> 
> Addresses-Coverity-ID: 1397932
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
>   drivers/gpu/drm/nouveau/nv50_display.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
> index a766324..052a60a 100644
> --- a/drivers/gpu/drm/nouveau/nv50_display.c
> +++ b/drivers/gpu/drm/nouveau/nv50_display.c
> @@ -2107,7 +2107,8 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state)
>   					asyc->set.dither = true;
>   			}
>   		} else {
> -			asyc->set.mask = ~0;
> +			if (asyc)
> +				asyc->set.mask = ~0;
>   			asyh->set.mask = ~0;
>   		}
>   
> 
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpu: drm: nouveau: add null check before pointer dereference
@ 2017-05-22 22:24   ` Ben Skeggs
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Skeggs @ 2017-05-22 22:24 UTC (permalink / raw)
  To: Gustavo A. R. Silva, David Airlie; +Cc: dri-devel, nouveau, linux-kernel

On 05/23/2017 05:12 AM, Gustavo A. R. Silva wrote:
> Add null check before dereferencing pointer asyc
I've taken the patch into my tree, thanks!

Ben.

> 
> Addresses-Coverity-ID: 1397932
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
>   drivers/gpu/drm/nouveau/nv50_display.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
> index a766324..052a60a 100644
> --- a/drivers/gpu/drm/nouveau/nv50_display.c
> +++ b/drivers/gpu/drm/nouveau/nv50_display.c
> @@ -2107,7 +2107,8 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state)
>   					asyc->set.dither = true;
>   			}
>   		} else {
> -			asyc->set.mask = ~0;
> +			if (asyc)
> +				asyc->set.mask = ~0;
>   			asyh->set.mask = ~0;
>   		}
>   
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-22 22:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22 19:12 [PATCH] gpu: drm: nouveau: add null check before pointer dereference Gustavo A. R. Silva
2017-05-22 22:24 ` Ben Skeggs
2017-05-22 22:24   ` Ben Skeggs

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.