aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/pci/hotplug/rpaphp_core.c
diff options
context:
space:
mode:
authorTyrel Datwyler <tyreld@linux.ibm.com>2019-11-10 23:21:31 -0600
committerMichael Ellerman <mpe@ellerman.id.au>2019-11-13 16:57:57 +1100
commit9723c25f99aff0451cfe6392e1b9fdd99d0bf9f0 (patch)
tree2b4dc4842bd70fa4647a5a08d423f02e9066f06a /drivers/pci/hotplug/rpaphp_core.c
parentpowerpc/pseries: Add cpu DLPAR support for drc-info property (diff)
downloadwireguard-linux-9723c25f99aff0451cfe6392e1b9fdd99d0bf9f0.tar.xz
wireguard-linux-9723c25f99aff0451cfe6392e1b9fdd99d0bf9f0.zip
PCI: rpaphp: Fix up pointer to first drc-info entry
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 <tyreld@linux.ibm.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/1573449697-5448-5-git-send-email-tyreld@linux.ibm.com
Diffstat (limited to 'drivers/pci/hotplug/rpaphp_core.c')
-rw-r--r--drivers/pci/hotplug/rpaphp_core.c2
1 files changed, 2 insertions, 0 deletions
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);