Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1242383pxa; Thu, 20 Aug 2020 06:34:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyljbwaiPNjaXedH7gS5T0JqyLm0+PtxYyYr6UuyBTlEWTwoJwp7k14IUqw70N5r/YpAl8G X-Received: by 2002:a17:907:119c:: with SMTP id uz28mr573620ejb.361.1597930440614; Thu, 20 Aug 2020 06:34:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597930440; cv=none; d=google.com; s=arc-20160816; b=F+kFRI7aY7Qa/HMAsX1+u8hAtnEmZh2jYNAY/5jwceKQgOhOQbAX1iEn1wllKYhSaK c3WvNRpKjVTzmYgYgyvBp4ZbsJjKejarnvjA1WNLBzGvSCTfHZQ17XnArhwtuTiQjiH2 Yw5OMCPYmVuBU1wLlJvPa2Pq9TdlOEnbZFJ0Bjat+lkYvaaLoKXEaR0/p2P/zLilmIGQ +S2d1GzkMRsL68Ia+3063akUVM82XqoANrzNFAbOhU3fUYPElNIXXN9F4sofm82zrur2 3jCiuDjEu/5wAPpBUO2pXRK50/J+0994sjATx1DaXVR4GSq9wg6PjqldJ06hGuVT7dBc 8CIQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Xis9NhBd2CaUjbI+5dgofOE+WIpixn8PamS7/skalqQ=; b=rWim3E3UoyESJxX1hOwcyug3riBdAC30QqDRRFvCxKdv8HDG7mQ4gyufYgxSsx/j3H oqt3Gc3+CfoBJgyzczQamN5kslmpM+VRn9alDUuHHPuXyQpYQNfK/Q87loSXgr15Obcz z5XigBRLzL1rcuB+/UpTU6zGw+wKEtyq14To9sS+mJsy6chi2ON/zssIw7LPJRXLQkQx fr0om/7YkzW/p9x2uFeKKj6AibStxtsmfWsbiB0xbrVeajVsIeNujoRT8XQIxDbZYXV/ OEXM0f531IOlpao8yYlU0FA/NDtW/hYvmGKMdyCjmilFW8ESI5CD1We932XyoYy5nPVp o1YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="E/8GZ+Iu"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si1345521eds.339.2020.08.20.06.33.35; Thu, 20 Aug 2020 06:34:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="E/8GZ+Iu"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728999AbgHTNax (ORCPT + 99 others); Thu, 20 Aug 2020 09:30:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:45294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728246AbgHTJcs (ORCPT ); Thu, 20 Aug 2020 05:32:48 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 52D9922CAE; Thu, 20 Aug 2020 09:32:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915967; bh=o5V+TZzJ4oLw40P7fnqae4aYSj8Ai1i0CGcdbBn5HyY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E/8GZ+Iu3wW976uesLT9RyPcXgmknCqpqQcUbbJGtJAh0TQuFIGeAx8hmi9Tp6sgY rUnu9cLB/WSYzH93bMpAHYUdLtufbagJ6WIYkjFyaTfE6wZOlw+rS7K3ryRjQixaSb q1jFtEIvIxcTh8KKL9fNi5uVHoVUxIdtCrSNWTEo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Roland Scheidegger , Sasha Levin Subject: [PATCH 5.8 198/232] drm/vmwgfx: Use correct vmw_legacy_display_unit pointer Date: Thu, 20 Aug 2020 11:20:49 +0200 Message-Id: <20200820091622.391011401@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 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: Dan Carpenter [ Upstream commit 1d2c0c565bc0da25f5e899a862fb58e612b222df ] The "entry" pointer is an offset from the list head and it doesn't point to a valid vmw_legacy_display_unit struct. Presumably the intent was to point to the last entry. Also the "i++" wasn't used so I have removed that as well. Fixes: d7e1958dbe4a ("drm/vmwgfx: Support older hardware.") Signed-off-by: Dan Carpenter Reviewed-by: Roland Scheidegger Signed-off-by: Roland Scheidegger Signed-off-by: Sasha Levin --- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c index 16dafff5cab19..009f1742bed51 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c @@ -81,7 +81,7 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv) struct vmw_legacy_display_unit *entry; struct drm_framebuffer *fb = NULL; struct drm_crtc *crtc = NULL; - int i = 0; + int i; /* If there is no display topology the host just assumes * that the guest will set the same layout as the host. @@ -92,12 +92,11 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv) crtc = &entry->base.crtc; w = max(w, crtc->x + crtc->mode.hdisplay); h = max(h, crtc->y + crtc->mode.vdisplay); - i++; } if (crtc == NULL) return 0; - fb = entry->base.crtc.primary->state->fb; + fb = crtc->primary->state->fb; return vmw_kms_write_svga(dev_priv, w, h, fb->pitches[0], fb->format->cpp[0] * 8, -- 2.25.1