Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11786454pjo; Thu, 2 Jan 2020 14:15:53 -0800 (PST) X-Google-Smtp-Source: APXvYqy1dFhrz5C6s76WHCWHUWqtGrtHaak3MFUAv5Vtmv1rOYPmx8PC2y6wreXV1sWsn/4gn/CG X-Received: by 2002:a9d:3e16:: with SMTP id a22mr98181154otd.259.1578003353679; Thu, 02 Jan 2020 14:15:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003353; cv=none; d=google.com; s=arc-20160816; b=Qgh0z/+ZC8GFN1V7gV1tt8NVHzF7eaRu91CH9LBVdQtGwuVuCEbBKCdI3E/0rMGX7V yrcXk7EYxyCo/DJ70nZtUE7WH2Ck4ZzvwF7/BJToE7tgacDCv5ht+obiW8lyG7kIdMyO qtjIDlzboqzDyJVubBrPprb0Mlm5PfZPkWCtlUC4+PKBJ/2WYIsweHvxOFiQG9QoCOfh 9iN1ZCe+38/AHAty/qF57ID7gOYqIb9Wi7hIlSIRCvxh6mNFG2Jzh8qQKy3dmhkOn4fS JCn941+U/htkEAQM4iRlc3E5IzvDxbVle7FltbYVRtlwkxeD9yGUHAcl4yrrmJRjm6Dv 93bg== 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=qzmeDPd4UFqkLusTt1GCEaWatEzV2nkPUJsdf0gpgLE=; b=nfGvQ/dEKz1DlECBbpBDylqzwQFJrLsq2EPUGQPtEv7+YX9ZHEWiEeSTH34T3InowE JX5H1MXQgLlh6IlTQtafKOmzW6TsOsvaXxi3/U6m0edKko2gduj7dEn5GvIeDVBWbu8N slse3LNw48pMnCg4O90jTlS0jWHxuhjFzr683w5qFUdQutLA8XhZfocVbPjKP6FoBxkt YtDk7dXtmasK82GZ6HH4+WbHMa0QduK/R5aFprEfaMtC4KXHAmvXiHW9I6knGUCgJL/j WzjClQ0K8mga/YeMXWrPCNCT954lRufhCqyggLZbGeLEqFJVHeW0Nta3SRDeC/vzULBq DQVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EB6yzEYO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11si28108260oti.325.2020.01.02.14.15.41; Thu, 02 Jan 2020 14:15:53 -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; dkim=pass header.i=@kernel.org header.s=default header.b=EB6yzEYO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727920AbgABWO3 (ORCPT + 99 others); Thu, 2 Jan 2020 17:14:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:54692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727912AbgABWO0 (ORCPT ); Thu, 2 Jan 2020 17:14:26 -0500 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 62A2524653; Thu, 2 Jan 2020 22:14:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003265; bh=Sdd+9oGeB8DlpNRG5CotalsKfgsgUEcu2SQl7U+pO2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EB6yzEYOwvgeLJOpDn4sFf8UXyxTY+9rnl2NyLi4+/ZsRfkFt0pecRyxl1SHBSniy U+RkzqXPKh8jDsJtg1hB3WV/RGVAM84CXQwCQ9p7FtOVQJsn+z4KQ6iYEvXTUTsFpO YYOTsdnYEAHipqo9ZIqMX8NnmnZD3bLE6qGbnp98= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tyrel Datwyler , Bjorn Helgaas , Michael Ellerman , Sasha Levin Subject: [PATCH 5.4 063/191] PCI: rpaphp: Fix up pointer to first drc-info entry Date: Thu, 2 Jan 2020 23:05:45 +0100 Message-Id: <20200102215836.725789187@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@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: Tyrel Datwyler [ Upstream commit 9723c25f99aff0451cfe6392e1b9fdd99d0bf9f0 ] The first entry of the ibm,drc-info property is an int encoded count of the number of drc-info entries that follow. The "value" pointer returned by of_prop_next_u32() is still pointing at the this value when we call of_read_drc_info_cell(), but the helper function expects that value to be pointing at the first element of an entry. Fix up by incrementing the "value" pointer to point at the first element of the first drc-info entry prior. Signed-off-by: Tyrel Datwyler Acked-by: Bjorn Helgaas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1573449697-5448-5-git-send-email-tyreld@linux.ibm.com Signed-off-by: Sasha Levin --- drivers/pci/hotplug/rpaphp_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c index 18627bb21e9e..e3502644a45c 100644 --- a/drivers/pci/hotplug/rpaphp_core.c +++ b/drivers/pci/hotplug/rpaphp_core.c @@ -239,6 +239,8 @@ static int rpaphp_check_drc_props_v2(struct device_node *dn, char *drc_name, value = of_prop_next_u32(info, NULL, &entries); if (!value) return -EINVAL; + else + value++; for (j = 0; j < entries; j++) { of_read_drc_info_cell(&info, &value, &drc); -- 2.20.1