From: Thomas Petazzoni Date: Wed, 17 Sep 2014 15:58:27 +0000 (+0200) Subject: PCI: mvebu: Fix uninitialized variable in mvebu_get_tgt_attr() X-Git-Tag: omap-for-v3.19/prcm-cleanup~136^2~9^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56fab6e189441d714a2bfc8a64f3df9c0749dff7;p=pandora-kernel.git PCI: mvebu: Fix uninitialized variable in mvebu_get_tgt_attr() 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 Signed-off-by: Thomas Petazzoni Signed-off-by: Bjorn Helgaas CC: stable@vger.kernel.org # v3.12+ --- Reading git-diff-tree failed