From 1b52d1881cba2d7f30788d0d6057b1766f296a8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Fri, 23 Nov 2018 20:16:01 +0100 Subject: [PATCH] Avoid null pointer dereference in pci_bus_write_dsdt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin PoviĊĦer --- src/lib/pci_emul.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/lib/pci_emul.c b/src/lib/pci_emul.c index e624d437..e732a85f 100644 --- a/src/lib/pci_emul.c +++ b/src/lib/pci_emul.c @@ -1223,15 +1223,8 @@ pci_bus_write_dsdt(int bus) /* * If there are no devices on this 'bus' then just return. */ - if ((bi = pci_businfo[bus]) == NULL) { - /* - * Bus 0 is special because it decodes the I/O ports used - * for PCI config space access even if there are no devices - * on it. - */ - if (bus != 0) - return; - } + if ((bi = pci_businfo[bus]) == NULL) + return; dsdt_fixup(bus, bi->iobase, bi->iolimit, bi->membase32, bi->memlimit32, bi->membase64, bi->memlimit64);