mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][next] drm/i915: fix uninitialized pointer reads on pointers to and from
@ 2019-12-19 19:09 Colin King
  2019-12-19 19:43 ` Chris Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2019-12-19 19:09 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie,
	Daniel Vetter, Chris Wilson, intel-gfx, dri-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently pointers to and from are not initialized and may contain
garbage values. This will cause uninitialized pointer reads in the
call to intel_frontbuffer_track and later checks to see if to and from
are null.  Fix this by ensuring to and from are initialized to NULL.

Addresses-Coverity: ("Uninitialised pointer read)"
Fixes: da42104f589d ("drm/i915: Hold reference to intel_frontbuffer as we track activity")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/i915/display/intel_overlay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c
index 6097594468a9..e869a3d86522 100644
--- a/drivers/gpu/drm/i915/display/intel_overlay.c
+++ b/drivers/gpu/drm/i915/display/intel_overlay.c
@@ -279,7 +279,7 @@ static void intel_overlay_flip_prepare(struct intel_overlay *overlay,
 				       struct i915_vma *vma)
 {
 	enum pipe pipe = overlay->crtc->pipe;
-	struct intel_frontbuffer *from, *to;
+	struct intel_frontbuffer *from = NULL, *to = NULL;
 
 	WARN_ON(overlay->old_vma);
 
-- 
2.24.0


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

* Re: [PATCH][next] drm/i915: fix uninitialized pointer reads on pointers to and from
  2019-12-19 19:09 [PATCH][next] drm/i915: fix uninitialized pointer reads on pointers to and from Colin King
@ 2019-12-19 19:43 ` Chris Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Wilson @ 2019-12-19 19:43 UTC (permalink / raw)
  To: Colin King, Daniel Vetter, David Airlie, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, dri-devel, intel-gfx
  Cc: kernel-janitors, linux-kernel

Quoting Colin King (2019-12-19 19:09:16)
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently pointers to and from are not initialized and may contain
> garbage values. This will cause uninitialized pointer reads in the
> call to intel_frontbuffer_track and later checks to see if to and from
> are null.  Fix this by ensuring to and from are initialized to NULL.
> 
> Addresses-Coverity: ("Uninitialised pointer read)"
> Fixes: da42104f589d ("drm/i915: Hold reference to intel_frontbuffer as we track activity")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

"D'oh"
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

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

end of thread, other threads:[~2019-12-19 19:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-19 19:09 [PATCH][next] drm/i915: fix uninitialized pointer reads on pointers to and from Colin King
2019-12-19 19:43 ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®