Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1939813ima; Thu, 25 Oct 2018 07:18:47 -0700 (PDT) X-Google-Smtp-Source: AJdET5fpVAZlVdzx0u/cNItlbSqNzDRS6LviM0qwegyPHXMfDIWHq/fr/2bhyTfWzOXxMU5lBivn X-Received: by 2002:a63:a612:: with SMTP id t18-v6mr1645819pge.338.1540477127564; Thu, 25 Oct 2018 07:18:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540477127; cv=none; d=google.com; s=arc-20160816; b=ypROsc/h26fU+KuWdL013omBdcqO/bboxNhCJwDAjYbgUsocUMuFDcTYn0dJLIbv0z ySS+LXpIEWuiJcYcdpOqtIHn+rjymNSU/Hh528IwhzlEEqPGOnAdsDAdf0CWYbF5kGMT FAJDaOPe5FhpkvxQbkuS7B5twQLCgE9iqDy9zWFkqPI3+eg8nq5prVb4HwTelDZ0vZjt h/I3QwEIh2d9w3mJkyOdzlN2oc/cVUnFJE1c4V67nE4nFwrrKWGYUDdpdNjTRK+xgR5j 1C8rzHqZMXXcZvj4KWqdFTr5ujn1S+ZEEOtlYycE+yiL8MCQdA23cxbXPLeEDqTWVPRL Y7+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=fjMxeEEV95zOHmw6E9Y+kwm4OfBCRNKS32FFc7TUxIA=; b=nD9eaq1SC/+HJ/hPWXNxtf02za9/2qx03N/3BaszOLfktqqSca29dQWN3DA+BSC4+I 7kTSgFOoLc3zcFnDuUg3OUDKPG5fNNCHtckuGA0SrIiQo33d3C6+ebs7Q1jKyJE5G7EZ D0AUA4kdFydfuYXRqMZIv1gbpd9A4tiyiSz0eHL5rXyhlwm35yxHkewypNkyuqeDy5an uJKfBfz+aq6iw+X4mUZQQIHPZNn/8LvmDwo+aSvH2sfdiu8BvMiS2fJnCD2MnE7B5m2f IBMuF1NXh0Xz7/czyK8vlyEGihXK7ML/zMPVOoXIIPIMDFUqL4nzPCdcSJOee3TOTjUZ Y4TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uifSirRD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k68-v6si885996pgk.294.2018.10.25.07.18.13; Thu, 25 Oct 2018 07:18:47 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=uifSirRD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728615AbeJYWrk (ORCPT + 99 others); Thu, 25 Oct 2018 18:47:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:55792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727505AbeJYWrj (ORCPT ); Thu, 25 Oct 2018 18:47:39 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BDF3B20848; Thu, 25 Oct 2018 14:14:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476883; bh=oEbptfxUcBjfEGTU0tN3sj/WqJVU6PsBjEMUtn4TZAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uifSirRDS4SU5jCI7hRS1RJNiAL+A4WOR5/YXd6Qe2I42dkz1BwErySZZuXULgifX KBTizosjq/PU2FKE3tcXkuekgBb70zkCMomho928gNwCg6NDBLiSbOdAjL+uKv/Uuk OnznGtty73fxf3KeUKplslbuaRJu1dxIrKo3S0PE= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bjorn Helgaas , Sasha Levin Subject: [PATCH AUTOSEL 4.9 11/98] efi/fb: Correct PCI_STD_RESOURCE_END usage Date: Thu, 25 Oct 2018 10:12:56 -0400 Message-Id: <20181025141423.213774-11-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141423.213774-1-sashal@kernel.org> References: <20181025141423.213774-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Helgaas [ Upstream commit 92a16c86299c64f58f320e491977408ba31b8c3c ] PCI_STD_RESOURCE_END is (confusingly) the index of the last valid BAR, not the *number* of BARs. To iterate through all possible BARs, we need to include PCI_STD_RESOURCE_END. Fixes: 55d728a40d36 ("efi/fb: Avoid reconfiguration of BAR that covers the framebuffer") Signed-off-by: Bjorn Helgaas Signed-off-by: Sasha Levin --- drivers/video/fbdev/efifb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index 6f2e729a308f..f4b6d063a4b7 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -375,7 +375,7 @@ static void efifb_fixup_resources(struct pci_dev *dev) if (!base) return; - for (i = 0; i < PCI_STD_RESOURCE_END; i++) { + for (i = 0; i <= PCI_STD_RESOURCE_END; i++) { struct resource *res = &dev->resource[i]; if (!(res->flags & IORESOURCE_MEM)) -- 2.17.1