qemu/hw
Peter Maydell bd0e501e1a hw/i386/pc: Don't try to init PCI NICs if there is no PCI bus
The 'isapc' machine type has no PCI bus, but pc_nic_init() still
calls pci_init_nic_devices() passing it a NULL bus pointer.  This
causes the clang sanitizer to complain:

$ ./build/clang/qemu-system-i386 -M isapc
../../hw/pci/pci.c:1866:39: runtime error: member access within null pointer of type 'PCIBus' (aka 'struct PCIBus')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../hw/pci/pci.c:1866:39 in

This is because pci_init_nic_devices() does
 &bus->qbus
which is undefined behaviour on a NULL pointer even though we're not
actually dereferencing the pointer. (We don't actually crash as
a result, so if you aren't running a sanitizer build then there
are no user-visible effects.)

Make pc_nic_init() avoid trying to initialize PCI NICs on a non-PCI
system.

Cc: qemu-stable@nongnu.org
Fixes: 8d39f9ba14 ("hw/i386/pc: use qemu_get_nic_info() and pci_init_nic_devices()")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Link: https://lore.kernel.org/r/20241105171813.3031969-1-peter.maydell@linaro.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-11-09 08:34:07 +01:00
..
9pfs 9p: remove 'proxy' filesystem backend driver 2024-10-03 19:33:25 +02:00
acpi hw/acpi: Update GED with vCPU Hotplug VMSD for migration 2024-11-04 16:03:25 -05:00
adc hw/adc: Remove MAX111X device 2024-10-15 15:16:17 +01:00
alpha
arm virtio,pc,pci: features, fixes, cleanups 2024-11-05 15:47:52 +00:00
audio replace error_setg(&error_fatal, ...) with error_report() 2024-10-21 22:40:47 +03:00
avr
block Misc HW patch queue 2024-11-06 17:28:45 +00:00
char hw/char: sifive_uart: Print uart characters async 2024-10-30 11:22:08 +10:00
core eif: cope with huge section sizes 2024-11-09 08:34:00 +01:00
cpu
cxl hw/cxl: Ensure there is enough data to read the input header in cmd_get_physical_port_state() 2024-11-04 16:03:25 -05:00
display virtio-gpu: Support Venus context 2024-10-28 16:56:36 +00:00
dma hw/dma: Remove omap_dma4 device 2024-10-01 14:58:07 +01:00
fsi hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
gpio hw/gpio/mpc8xxx: Prefer DEFINE_TYPES() macro 2024-11-05 23:32:25 +00:00
hppa hw/char: Extract serial-mm 2024-10-03 19:33:23 +02:00
hyperv hw/hyperv: remove return after g_assert_not_reached() 2024-09-24 13:53:35 +02:00
i2c hw/i2c/smbus_eeprom: Prefer DEFINE_TYPES() macro 2024-11-05 23:32:25 +00:00
i386 hw/i386/pc: Don't try to init PCI NICs if there is no PCI bus 2024-11-09 08:34:07 +01:00
ide hw/ide: Remove DSCM-1XXXX microdrive device model 2024-10-15 15:16:17 +01:00
input hw/input: Remove lm832x device 2024-10-01 14:41:10 +01:00
intc pnv/xive2: TIMA CI ops using alternative offsets or byte lengths 2024-11-04 09:14:54 +10:00
ipack
ipmi
isa hw/char/serial.h: Extract serial-isa.h 2024-10-03 19:33:23 +02:00
loongarch hw/loongarch/boot: Use warn_report when no kernel filename 2024-11-02 15:20:41 +08:00
m68k next-cube: remove cpu parameter from next_scsi_init() 2024-11-04 14:16:11 +01:00
mem hw/cxl/cxl-mailbox-utils: Fix for device DDR5 ECS control feature tables 2024-11-04 16:03:24 -05:00
microblaze hw/microblaze/s3adsp1800: Declare machine type using DEFINE_TYPES macro 2024-11-05 23:32:13 +00:00
mips hw/mips: Have mips_cpu_create_with_clock() take an endianness argument 2024-10-15 12:21:06 -03:00
misc hw/misc/aspeed_hace: Fix SG Accumulative hashing 2024-10-24 07:57:47 +02:00
net Misc HW patch queue 2024-11-06 17:28:45 +00:00
nubus hw/nubus/nubus-device: Range check 'slot' property 2024-09-08 11:49:49 +02:00
nvme hw/nvme: remove dead code 2024-11-04 19:09:45 +01:00
nvram hw: Remove unused fw_cfg_init_io 2024-10-03 17:26:06 +03:00
openrisc hw/char: Extract serial-mm 2024-10-03 19:33:23 +02:00
pci pcie: enable Extended tag field support 2024-11-04 16:03:25 -05:00
pci-bridge hw/pci-bridge: Make pxb_dev_realize_common() return if it succeeded 2024-11-04 16:03:25 -05:00
pci-host Misc HW patch queue 2024-11-06 17:28:45 +00:00
ppc hw/ppc/mpc8544_guts: Prefer DEFINE_TYPES() macro 2024-11-05 23:32:25 +00:00
remote remote: Remove unused remote_iohub_finalize 2024-10-03 17:26:06 +03:00
riscv hw/riscv/iommu: fix build error with clang 2024-11-05 23:32:25 +00:00
rtc Misc HW patch queue 2024-11-06 17:28:45 +00:00
rx
s390x hw/s390x: Re-enable the pci-bridge device on s390x 2024-11-04 14:16:11 +01:00
scsi hw/vhost-scsi: fix -Werror=maybe-uninitialized 2024-10-02 16:14:29 +04:00
sd hw/sd/sdhci: Prefer DEFINE_TYPES() macro 2024-11-05 23:32:25 +00:00
sensor hw/sensor/tmp105: Convert printf() to trace event, add tracing for read/write access 2024-11-05 10:10:00 +00:00
sh4 Revert "hw/sh4/r2d: Realize IDE controller before accessing it" 2024-10-21 16:40:11 +02:00
smbios
sparc hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
sparc64 hw/char: Extract serial-mm 2024-10-03 19:33:23 +02:00
ssi hw/ssi/pnv_spi: Fixes Coverity CID 1558831 2024-11-04 09:09:15 +10:00
timer target-arm queue: 2024-11-05 21:27:18 +00:00
tpm hw/tpm: remove break after g_assert_not_reached() 2024-09-24 13:53:35 +02:00
tricore hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
ufs hw/ufs: minor bug fixes related to ufs-test 2024-09-06 18:04:16 +09:00
usb hw/usb/hcd-ehci-sysbus: Prefer DEFINE_TYPES() macro 2024-11-05 23:32:25 +00:00
vfio vfio/migration: Add vfio_save_block_precopy_empty_hit trace event 2024-11-05 15:51:14 +01:00
virtio virtio,pc,pci: features, fixes, cleanups 2024-11-05 15:47:52 +00:00
watchdog hw/watchdog/wdt_imx2: Remove redundant assignment 2024-11-05 10:10:00 +00:00
xen hw/xen: Avoid use of uninitialized bufioreq_evtchn 2024-10-21 07:53:21 +02:00
xenpv
xtensa hw/xtensa/xtfpga: Remove TARGET_BIG_ENDIAN #ifdef'ry 2024-10-15 12:13:59 -03:00
Kconfig hw: Remove PCMCIA subsystem 2024-10-15 15:16:17 +01:00
meson.build hw: Remove PCMCIA subsystem 2024-10-15 15:16:17 +01:00