Skip to contentSkip to conversation

gpu: drm: nouveau: add null check before pointer dereference

PATCH In review Gustavo A. R. Silva 2 participants 2 messages May 22, 2017

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

PATCH 1/1 gpu: drm: nouveau: add null check before pointer dereference

Add null check before dereferencing pointer asyc

Addresses-Coverity-ID: 1397932

---
 drivers/gpu/drm/nouveau/nv50_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nv50_display.c +2 -1
index a766324..052a60a 100644
@@ -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;
 		}
 
Signature · 1 line
2.5.0
#1 lore raw
Quoted 1 line · Gustavo A. R. Silva

Add null check before dereferencing pointer asyc

I've taken the patch into my tree, thanks!

Ben.

Quoted 13 lines

Addresses-Coverity-ID: 1397932

---
  drivers/gpu/drm/nouveau/nv50_display.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nv50_display.c +0 -0
index a766324..052a60a 100644

drivers/gpu/drm/nouveau/nv50_display.c nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state) · line 2114

Quoted 9 lines
drivers/gpu/drm/nouveau/nv50_display.c +2 -1
@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau