Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2296733ybl; Thu, 19 Dec 2019 11:10:30 -0800 (PST) X-Google-Smtp-Source: APXvYqzwmUoepEvMvMAX4amuQZfLMUBkn1+N+ue4UzFnprzXULZ3/egw5iSOarfzxNF/LAkckfmX X-Received: by 2002:a05:6830:2141:: with SMTP id r1mr10321078otd.39.1576782629928; Thu, 19 Dec 2019 11:10:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576782629; cv=none; d=google.com; s=arc-20160816; b=ok4ZNtx3oZYV4wTHFwkZ661paPXqtvFdoIS0qt0593/jyQv03TWqfPe6c8hPL81+LU s+epOt3nHyUSSRyIE1zRi+tKcYtch13W7y6nvJ67ofHgz9NiERbqGR+MGsSU92+kPy6u 0M6+eR+26m+EFIAeild0mHD4FKLNFpFLUDdHDxmjNsCZj5fPCxsAQ6NAvj/Hqckamg7E M4n+QNopldsFlqXS5YrAb1qn3PW0y23YWE4I4Dy3OF1ocFQTXsNYgYxBu5OXBLVfAcVV 5WvKR76m7vkSuKg1JqPNDiESA3xMxzoQfi3ElA+h6bObCKG0nlx+oyZXYjsYUgZ7MscR 5Q1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=vxX0dkaYyNZ172E597pBrxXUE4UALJFIyOcMyrYH7+c=; b=FOEdIbn4dMR8ycmcau/M/VLPHVqAQI6kO1DJcXmQsyVAWcRB+8LyreipvudZoQb2yU AGOI56iKKIoPk71jzqY1tbp7LGiAX3whHs99P8wiFlM1MQjhyfVAQI/tzMzXHFJbL6x3 RSbnztjiyVJfHn+FHmp4eJbtJFs9L0D60gVrZ8ClODLkutJBuw3EkVJtIWOZcOfP1WGF PM2z1xEdNORaw9PPVMA+czFt+eg8W4cEVw0kEHzj+f6CT7H0RK8rgnZQCDwW0fJtXiwN kUnJg8hBQp2sco6XkykbpoKE7JBUmvJcK9foDUnnM5kR08Q9eDPjeN2+2Gfmg2jRUFxX DstA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s26si3707535otr.38.2019.12.19.11.10.18; Thu, 19 Dec 2019 11:10:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728719AbfLSTJ3 (ORCPT + 99 others); Thu, 19 Dec 2019 14:09:29 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:50374 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727504AbfLSTJ0 (ORCPT ); Thu, 19 Dec 2019 14:09:26 -0500 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ii1Aj-0004qM-07; Thu, 19 Dec 2019 19:09:17 +0000 From: Colin King To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Chris Wilson , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] drm/i915: fix uninitialized pointer reads on pointers to and from Date: Thu, 19 Dec 2019 19:09:16 +0000 Message-Id: <20191219190916.24693-1-colin.king@canonical.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King 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 --- 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