* [pci:pci/enumeration 6/6] drivers/pci/of.c:40 pci_set_bus_of_node() error: we previously assumed 'bus->self' could be null (see line 34)
@ 2019-04-10 19:49 Dan Carpenter
2019-04-10 21:21 ` Bjorn Helgaas
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2019-04-10 19:49 UTC (permalink / raw)
To: kbuild, Jean-Philippe Brucker
Cc: kbuild-all, linux-pci, Bjorn Helgaas, Robin Murphy, Grant Likely
tree: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/enumeration
head: 60ea7f5dd97ed9949e6fbf67e93c9b2c38cc9eb7
commit: 60ea7f5dd97ed9949e6fbf67e93c9b2c38cc9eb7 [6/6] PCI: OF: Support "external-facing" property
smatch warnings:
drivers/pci/of.c:40 pci_set_bus_of_node() error: we previously assumed 'bus->self' could be null (see line 34)
# https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?id=60ea7f5dd97ed9949e6fbf67e93c9b2c38cc9eb7
git remote add pci https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
git remote update pci
git checkout 60ea7f5dd97ed9949e6fbf67e93c9b2c38cc9eb7
vim +40 drivers/pci/of.c
98d9f30c82 Benjamin Herrenschmidt 2011-04-11 31
98d9f30c82 Benjamin Herrenschmidt 2011-04-11 32 void pci_set_bus_of_node(struct pci_bus *bus)
98d9f30c82 Benjamin Herrenschmidt 2011-04-11 33 {
98d9f30c82 Benjamin Herrenschmidt 2011-04-11 @34 if (bus->self == NULL)
98d9f30c82 Benjamin Herrenschmidt 2011-04-11 35 bus->dev.of_node = pcibios_get_phb_of_node(bus);
98d9f30c82 Benjamin Herrenschmidt 2011-04-11 36 else
98d9f30c82 Benjamin Herrenschmidt 2011-04-11 37 bus->dev.of_node = of_node_get(bus->self->dev.of_node);
60ea7f5dd9 Jean-Philippe Brucker 2019-04-02 38
60ea7f5dd9 Jean-Philippe Brucker 2019-04-02 39 if (of_get_property(bus->dev.of_node, "external-facing", NULL))
60ea7f5dd9 Jean-Philippe Brucker 2019-04-02 @40 bus->self->untrusted = true;
98d9f30c82 Benjamin Herrenschmidt 2011-04-11 41 }
98d9f30c82 Benjamin Herrenschmidt 2011-04-11 42
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [pci:pci/enumeration 6/6] drivers/pci/of.c:40 pci_set_bus_of_node() error: we previously assumed 'bus->self' could be null (see line 34)
2019-04-10 19:49 [pci:pci/enumeration 6/6] drivers/pci/of.c:40 pci_set_bus_of_node() error: we previously assumed 'bus->self' could be null (see line 34) Dan Carpenter
@ 2019-04-10 21:21 ` Bjorn Helgaas
2019-04-10 21:59 ` Robin Murphy
0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2019-04-10 21:21 UTC (permalink / raw)
To: Dan Carpenter
Cc: kbuild, Jean-Philippe Brucker, kbuild-all, linux-pci,
Robin Murphy, Grant Likely
On Wed, Apr 10, 2019 at 10:49:01PM +0300, Dan Carpenter wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/enumeration
> head: 60ea7f5dd97ed9949e6fbf67e93c9b2c38cc9eb7
> commit: 60ea7f5dd97ed9949e6fbf67e93c9b2c38cc9eb7 [6/6] PCI: OF: Support "external-facing" property
>
> smatch warnings:
> drivers/pci/of.c:40 pci_set_bus_of_node() error: we previously assumed 'bus->self' could be null (see line 34)
Yep, that looks like a problem. I dropped these for now:
60ea7f5dd97e PCI: OF: Support "external-facing" property
6201cf80200c dt-bindings: Add "external-facing" PCIe port property
> # https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?id=60ea7f5dd97ed9949e6fbf67e93c9b2c38cc9eb7
> git remote add pci https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
> git remote update pci
> git checkout 60ea7f5dd97ed9949e6fbf67e93c9b2c38cc9eb7
> vim +40 drivers/pci/of.c
>
> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 31
> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 32 void pci_set_bus_of_node(struct pci_bus *bus)
> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 33 {
> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 @34 if (bus->self == NULL)
> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 35 bus->dev.of_node = pcibios_get_phb_of_node(bus);
> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 36 else
> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 37 bus->dev.of_node = of_node_get(bus->self->dev.of_node);
> 60ea7f5dd9 Jean-Philippe Brucker 2019-04-02 38
> 60ea7f5dd9 Jean-Philippe Brucker 2019-04-02 39 if (of_get_property(bus->dev.of_node, "external-facing", NULL))
> 60ea7f5dd9 Jean-Philippe Brucker 2019-04-02 @40 bus->self->untrusted = true;
> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 41 }
> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 42
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [pci:pci/enumeration 6/6] drivers/pci/of.c:40 pci_set_bus_of_node() error: we previously assumed 'bus->self' could be null (see line 34)
2019-04-10 21:21 ` Bjorn Helgaas
@ 2019-04-10 21:59 ` Robin Murphy
0 siblings, 0 replies; 3+ messages in thread
From: Robin Murphy @ 2019-04-10 21:59 UTC (permalink / raw)
To: Bjorn Helgaas, Dan Carpenter
Cc: kbuild, Jean-Philippe Brucker, kbuild-all, linux-pci, Grant Likely
On 2019-04-10 10:21 pm, Bjorn Helgaas wrote:
> On Wed, Apr 10, 2019 at 10:49:01PM +0300, Dan Carpenter wrote:
>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/enumeration
>> head: 60ea7f5dd97ed9949e6fbf67e93c9b2c38cc9eb7
>> commit: 60ea7f5dd97ed9949e6fbf67e93c9b2c38cc9eb7 [6/6] PCI: OF: Support "external-facing" property
>>
>> smatch warnings:
>> drivers/pci/of.c:40 pci_set_bus_of_node() error: we previously assumed 'bus->self' could be null (see line 34)
>
> Yep, that looks like a problem. I dropped these for now:
>
> 60ea7f5dd97e PCI: OF: Support "external-facing" property
> 6201cf80200c dt-bindings: Add "external-facing" PCIe port property
I guess we don't expect to see this property on the host bridge device
itself (hence the need to extend the DT description down to the root
port(s)), so in theory we should only crash here if the firmware got the
binding wrong, but I agree that's something definitely worth being
robust against.
Robin.
>> # https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?id=60ea7f5dd97ed9949e6fbf67e93c9b2c38cc9eb7
>> git remote add pci https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
>> git remote update pci
>> git checkout 60ea7f5dd97ed9949e6fbf67e93c9b2c38cc9eb7
>> vim +40 drivers/pci/of.c
>>
>> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 31
>> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 32 void pci_set_bus_of_node(struct pci_bus *bus)
>> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 33 {
>> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 @34 if (bus->self == NULL)
>> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 35 bus->dev.of_node = pcibios_get_phb_of_node(bus);
>> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 36 else
>> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 37 bus->dev.of_node = of_node_get(bus->self->dev.of_node);
>> 60ea7f5dd9 Jean-Philippe Brucker 2019-04-02 38
>> 60ea7f5dd9 Jean-Philippe Brucker 2019-04-02 39 if (of_get_property(bus->dev.of_node, "external-facing", NULL))
>> 60ea7f5dd9 Jean-Philippe Brucker 2019-04-02 @40 bus->self->untrusted = true;
>> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 41 }
>> 98d9f30c82 Benjamin Herrenschmidt 2011-04-11 42
>>
>> ---
>> 0-DAY kernel test infrastructure Open Source Technology Center
>> https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-04-10 21:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-10 19:49 [pci:pci/enumeration 6/6] drivers/pci/of.c:40 pci_set_bus_of_node() error: we previously assumed 'bus->self' could be null (see line 34) Dan Carpenter
2019-04-10 21:21 ` Bjorn Helgaas
2019-04-10 21:59 ` Robin Murphy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).