From patchwork Wed Jan 1 11:14:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Cole-Baker X-Patchwork-Id: 239044 List-Id: U-Boot discussion From: sigmaris at gmail.com (Hugh Cole-Baker) Date: Wed, 1 Jan 2020 11:14:28 +0000 Subject: [PATCH] drivers: pci: initialise class to 0 before reading Message-ID: <20200101111428.11392-1-sigmaris@gmail.com> Otherwise, uninitialised memory from the upper 32 bits can end up in find_id.class, and this causes bugs later when looking for a driver for the class. Signed-off-by: Hugh Cole-Baker --- drivers/pci/pci-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index fab20fc60e..c28a1cc363 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -773,7 +773,7 @@ int pci_bind_bus_devices(struct udevice *bus) bdf += PCI_BDF(0, 0, 1)) { struct pci_child_platdata *pplat; struct udevice *dev; - ulong class; + ulong class = 0; if (!PCI_FUNC(bdf)) found_multi = false;