linux/drivers/pci/host
Thomas Petazzoni 1ed8711eab PCI: mvebu: Fix uninitialized variable in mvebu_get_tgt_attr()
commit 56fab6e189 upstream.

Geert Uytterhoeven reported a warning when building pci-mvebu:

  drivers/pci/host/pci-mvebu.c: In function 'mvebu_get_tgt_attr':
  drivers/pci/host/pci-mvebu.c:887:39: warning: 'rtype' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (slot == PCI_SLOT(devfn) && type == rtype) {
					 ^

And indeed, the code of mvebu_get_tgt_attr() may lead to the usage of rtype
when being uninitialized, even though it would only happen if we had
entries other than I/O space and 32 bits memory space.

This commit fixes that by simply skipping the current DT range being
considered, if it doesn't match the resource type we're looking for.

Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30 09:38:23 -07:00
..
Kconfig PCI changes for the v3.13 merge window: 2013-11-14 14:02:00 +09:00
Makefile Merge branch 'pci/host-rcar' into next 2013-10-31 13:58:49 -06:00
pci-exynos.c PCI: designware: Add dw_pcie prefix before cfg_read/write 2013-12-20 09:18:31 -07:00
pci-imx6.c PCI: imx6: Wait for retraining 2014-05-06 07:59:27 -07:00
pci-mvebu.c PCI: mvebu: Fix uninitialized variable in mvebu_get_tgt_attr() 2014-10-30 09:38:23 -07:00
pci-rcar-gen2.c PCI: rcar: Add runtime PM support 2013-12-09 16:24:37 -07:00
pci-tegra.c ARM: SoC cleanups for 3.14 2014-01-23 18:36:55 -08:00
pcie-designware.c PCI: designware: Fix iATU programming for cfg1, io and mem viewport 2014-04-26 17:19:03 -07:00
pcie-designware.h PCI: designware: Add dw_pcie prefix before cfg_read/write 2013-12-20 09:18:31 -07:00