]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 Aug 2018 20:23:30 +0000 (13:23 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 Aug 2018 20:23:30 +0000 (13:23 -0700)
added patches:
sparc-kernel-pcic-silence-gcc-7.x-warning-in-pcibios_fixup_bus.patch

queue-4.9/series
queue-4.9/sparc-kernel-pcic-silence-gcc-7.x-warning-in-pcibios_fixup_bus.patch [new file with mode: 0644]

index f8bf7b46c10b72d731b6072e5257789160995f71..3f1ed003d1d7c337ebb6cca7bc06e574ec123678 100644 (file)
@@ -63,3 +63,4 @@ ext4-reset-error-code-in-ext4_find_entry-in-fallback.patch
 staging-android-ion-fix-ion_ioc_-map-share-use-after-free.patch
 kvm-arm-arm64-skip-updating-pte-entry-if-no-change.patch
 kvm-arm-arm64-skip-updating-pmd-entry-if-no-change.patch
+sparc-kernel-pcic-silence-gcc-7.x-warning-in-pcibios_fixup_bus.patch
diff --git a/queue-4.9/sparc-kernel-pcic-silence-gcc-7.x-warning-in-pcibios_fixup_bus.patch b/queue-4.9/sparc-kernel-pcic-silence-gcc-7.x-warning-in-pcibios_fixup_bus.patch
new file mode 100644 (file)
index 0000000..fbebede
--- /dev/null
@@ -0,0 +1,56 @@
+From 2dc77533f1e495788d73ffa4bee4323b2646d2bb Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Sun, 13 Aug 2017 23:14:58 +0200
+Subject: sparc: kernel/pcic: silence gcc 7.x warning in pcibios_fixup_bus()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+commit 2dc77533f1e495788d73ffa4bee4323b2646d2bb upstream.
+
+When building the kernel for Sparc using gcc 7.x, the build fails
+with:
+
+arch/sparc/kernel/pcic.c: In function ‘pcibios_fixup_bus’:
+arch/sparc/kernel/pcic.c:647:8: error: ‘cmd’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
+    cmd |= PCI_COMMAND_IO;
+        ^~
+
+The simplified code looks like this:
+
+unsigned int cmd;
+[...]
+pcic_read_config(dev->bus, dev->devfn, PCI_COMMAND, 2, &cmd);
+[...]
+cmd |= PCI_COMMAND_IO;
+
+I.e, the code assumes that pcic_read_config() will always initialize
+cmd. But it's not the case. Looking at pcic_read_config(), if
+bus->number is != 0 or if the size is not one of 1, 2 or 4, *val will
+not be initialized.
+
+As a simple fix, we initialize cmd to zero at the beginning of
+pcibios_fixup_bus.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Cc: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/sparc/kernel/pcic.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/sparc/kernel/pcic.c
++++ b/arch/sparc/kernel/pcic.c
+@@ -602,7 +602,7 @@ void pcibios_fixup_bus(struct pci_bus *b
+ {
+       struct pci_dev *dev;
+       int i, has_io, has_mem;
+-      unsigned int cmd;
++      unsigned int cmd = 0;
+       struct linux_pcic *pcic;
+       /* struct linux_pbm_info* pbm = &pcic->pbm; */
+       int node;