Gustavo A. R. Silva
2017-May-22 19:12 UTC
[Nouveau] [PATCH] gpu: drm: nouveau: add null check before pointer dereference
Add null check before dereferencing pointer asyc Addresses-Coverity-ID: 1397932 Signed-off-by: Gustavo A. R. Silva <garsilva at 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
Ben Skeggs
2017-May-22 22:24 UTC
[Nouveau] [PATCH] gpu: drm: nouveau: add null check before pointer dereference
On 05/23/2017 05:12 AM, Gustavo A. R. Silva wrote:> Add null check before dereferencing pointer asycI've taken the patch into my tree, thanks! Ben.> > Addresses-Coverity-ID: 1397932 > Signed-off-by: Gustavo A. R. Silva <garsilva at 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; > } > >
Seemingly Similar Threads
- [PATCH] gpu: drm: nouveau: add null check before pointer dereference
- [Intel-gfx] [PATCH 15/16] drm/nouveau: Convert nouveau to use new iterator macros
- [drm-nouveau-mmu] question about potential NULL pointer dereference
- [PATCH v2 6/7] drm/nouveau: Convert nouveau to use new iterator macros, v2.
- [PATCH 15/16] drm/nouveau: Convert nouveau to use new iterator macros