Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11791429pjo; Thu, 2 Jan 2020 14:20:51 -0800 (PST) X-Google-Smtp-Source: APXvYqzAi7SH8MCV1isA2igW4lZdm8T2KyN0YzDGHErbtW/yHZkyswpBhMSc0O3mNEw1kTWTiEW6 X-Received: by 2002:a9d:68cc:: with SMTP id i12mr57349141oto.207.1578003651182; Thu, 02 Jan 2020 14:20:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003651; cv=none; d=google.com; s=arc-20160816; b=culSfcqqGWjhm5TPC1k77Ee1lV6te2znIkjFsqYZPu4BsQePSXyVtpvbDg7A+Qnjw2 rjmz2lfnAJyLHpNf3WnoM5oX5HqI4su6c42oBZGnj0ND9hUM8MdNlPCdeNMmJus9tqo2 PA8RBGSdoonbaUVkB++1j97CUr0gMT46dCdNdVCwmCacx7U+We6HgluLlYjQ6stmPXTi hbtBW4JjoVuVn+PKf2+gtijWool44Sp4j2HdW6ZkltNNXHYHQ+46MPd45xUfsgXhUjdA /QJePdSfQmmD7bvzx1dTJVYZOmtAqW3JklyQTXQNz/vJfsAn+oYYxsDp1bonEOMkha+Q EliA== 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=byxxFGglifhw1HrOXIItH1ae4Gv3tPJ/NrundWaJlAA=; b=kiylLH/Y6P9Gqo3d4jA6Um2/2cjyR5W1exaLyGbhcckdlEzH+sZ6W3tk0es5jwHq9t D5v83MjDTS5NLaNFX1LmGnjUcCtDzqIw37BVENWube9rr60dBNsDNBbVktrPkJ5Q0TGs 3Em64SFJ3xKEZBUhAUy1Nc67qAyoQbzy9emGTc8JduQebWr/5gRPTC3J5mDPnF/D0/8u 3dTNDtXgojiXbGRaiDM+g7ehvAMshRwsiyb2e9GMUng9bTIFc43Ws0E8c7XurE99mAi4 8mmGNVdFCDSdIJ3pEjUe7I+Od57ZYOMHJY37NnTRlX9IGexTdNU5hW/cNBGB1edHZFBH A7Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1sy9OUFp; 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 f25si19257790oti.244.2020.01.02.14.20.38; Thu, 02 Jan 2020 14:20:51 -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=1sy9OUFp; 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 S1728712AbgABWT7 (ORCPT + 99 others); Thu, 2 Jan 2020 17:19:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:36662 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728691AbgABWT4 (ORCPT ); Thu, 2 Jan 2020 17:19:56 -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 BD79421582; Thu, 2 Jan 2020 22:19:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003596; bh=kZcTL9tAJMrBdan8lMVYHcwWVatpSIctS3+lsaHzVEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1sy9OUFpJHZcvtulbaG8ENhc9OTUol+cmQ7sLyw6etY+Cc2grOMrllNk+skVC0nOm rvZ+o8YwhxUte1lYeXR2veQhRt2pBgHchi1DSp5E4oa+J/GwqkknIqd+wnxYe+JlLR SdCGw5MydKRJT2bjNDJxwruacph5oHmUbUblsqQU= 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 4.19 035/114] PCI: rpaphp: Fix up pointer to first drc-info entry Date: Thu, 2 Jan 2020 23:06:47 +0100 Message-Id: <20200102220032.630670712@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220029.183913184@linuxfoundation.org> References: <20200102220029.183913184@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 cc860c5f7d26..f56004243591 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