linux-stable/drivers/pci
Xinghui Li 0eeb5fbfd1 PCI: vmd: Fix uninitialized variable usage in vmd_enable_domain()
[ Upstream commit 0c0206dc4f ]

The ret variable in the vmd_enable_domain() function was used
uninitialized when printing a warning message upon failure of
the pci_reset_bus() function.

Thus, fix the issue by assigning ret with the value returned from
pci_reset_bus() before referencing it in the warning message.

This was detected by Smatch:

  drivers/pci/controller/vmd.c:931 vmd_enable_domain() error: uninitialized symbol 'ret'.

[kwilczynski: drop the second patch from the series, add missing reported
by tag, commit log]
Fixes: 0a584655ef ("PCI: vmd: Fix secondary bus reset for Intel bridges")
Link: https://lore.kernel.org/all/202305270219.B96IiIfv-lkp@intel.com
Link: https://lore.kernel.org/linux-pci/20230420094332.1507900-2-korantwork@gmail.com
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Xinghui Li <korantli@tencent.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Nirmal Patel <nirmal.patel@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-11 19:39:49 +02:00
..
controller PCI: vmd: Fix uninitialized variable usage in vmd_enable_domain() 2023-07-11 19:39:49 +02:00
endpoint PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction 2023-07-11 19:39:49 +02:00
hotplug PCI: pciehp: Cancel bringup sequence if card is not present 2023-07-11 19:39:45 +02:00
msi PCI/MSI: Remove over-zealous hardware size check in pci_msix_validate_entries() 2023-04-16 14:11:51 +02:00
pcie PCI/ASPM: Disable ASPM on MFD function removal to avoid use-after-free 2023-07-11 19:39:45 +02:00
switch PCI: switchtec: Return -EFAULT for copy_to_user() errors 2023-01-18 11:11:20 -06:00
Kconfig genirq: Get rid of GENERIC_MSI_IRQ_DOMAIN 2022-11-17 15:15:20 +01:00
Makefile
access.c PCI: Access Link 2 registers only for devices with Links 2022-11-04 10:38:11 -05:00
ats.c PCI: Enable PASID only when ACS RR & UF enabled on upstream path 2022-11-03 15:47:47 +01:00
bus.c PCI: s390: Fix use-after-free of PCI resources with per-function hotplug 2023-03-13 09:15:11 +01:00
doe.c PCI/DOE: Fix memory leak with CONFIG_DEBUG_OBJECTS=y 2023-04-03 16:17:21 -07:00
ecam.c
host-bridge.c
iov.c PCI/IOV: Enlarge virtfn sysfs name buffer 2023-01-18 10:54:41 -06:00
irq.c PCI: Check for alloc failure in pci_request_irq() 2022-11-21 16:55:18 -06:00
mmap.c PCI: Remove pci_mmap_page_range() wrapper 2022-07-29 12:08:44 -05:00
of.c PCI: Restrict device disabled status check to DT 2023-04-20 13:30:14 -05:00
p2pdma.c PCI/P2PDMA: Annotate RCU dereference 2023-02-16 16:31:12 -06:00
pci-acpi.c PCI/ACPI: Call _REG when transitioning D-states 2023-07-05 18:29:23 +01:00
pci-bridge-emul.c PCI: pci-bridge-emul: Set position of PCI capabilities to real HW value 2022-08-25 12:07:56 +02:00
pci-bridge-emul.h PCI: pci-bridge-emul: Set position of PCI capabilities to real HW value 2022-08-25 12:07:56 +02:00
pci-driver.c pci-v6.3-changes 2023-02-24 16:51:40 -08:00
pci-label.c
pci-mid.c
pci-pf-stub.c
pci-stub.c
pci-sysfs.c pci-v6.2-changes 2022-12-14 09:54:10 -08:00
pci.c pci-v6.3-changes 2023-02-24 16:51:40 -08:00
pci.h PCI: Restrict device disabled status check to DT 2023-04-20 13:30:14 -05:00
probe.c PCI: Restrict device disabled status check to DT 2023-04-20 13:30:14 -05:00
proc.c PCI: Remove pci_mmap_page_range() wrapper 2022-07-29 12:08:44 -05:00
quirks.c PCI/DPC: Quirk PIO log size for Intel Ice Lake Root Ports 2023-06-21 16:02:06 +02:00
remove.c PCI: Fix use-after-free in pci_bus_release_domain_nr() 2023-04-06 18:20:59 -05:00
rom.c
search.c
setup-bus.c PCI: Distribute available resources for root buses, too 2023-02-07 11:36:35 -06:00
setup-irq.c
setup-res.c PCI: Sanitise firmware BAR assignments behind a PCI-PCI bridge 2022-09-21 17:52:47 -05:00
slot.c PCI/sysfs: Constify struct kobj_type pci_slot_ktype 2023-02-16 12:00:25 -06:00
syscall.c
vc.c
vgaarb.c
vpd.c
xen-pcifront.c xen: make remove callback of xen driver void returned 2022-12-15 16:06:10 +01:00