From: Greg Kroah-Hartman Date: Thu, 5 Oct 2017 09:16:54 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v3.18.74~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e78bcfda46f4cb3a3b1ce211652bb5567576e3e3;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: alsa-au88x0-avoid-theoretical-uninitialized-access.patch arm-remove-duplicate-const-annotations.patch drivers-firmware-psci-drop-duplicate-const-from-psci_of_match.patch ib-qib-fix-false-postive-maybe-uninitialized-warning.patch ttpci-address-stringop-overflow-warning.patch --- diff --git a/queue-4.4/alsa-au88x0-avoid-theoretical-uninitialized-access.patch b/queue-4.4/alsa-au88x0-avoid-theoretical-uninitialized-access.patch new file mode 100644 index 00000000000..3012aa2383b --- /dev/null +++ b/queue-4.4/alsa-au88x0-avoid-theoretical-uninitialized-access.patch @@ -0,0 +1,40 @@ +From 13f99ebdd602ebdafb909e15ec6ffb1e34690167 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 23 Mar 2017 16:15:55 +0100 +Subject: ALSA: au88x0: avoid theoretical uninitialized access + +From: Arnd Bergmann + +commit 13f99ebdd602ebdafb909e15ec6ffb1e34690167 upstream. + +The latest gcc-7.0.1 snapshot points out that we if nr_ch is zero, we never +initialize some variables: + +sound/pci/au88x0/au88x0_core.c: In function 'vortex_adb_allocroute': +sound/pci/au88x0/au88x0_core.c:2304:68: error: 'mix[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized] +sound/pci/au88x0/au88x0_core.c:2305:58: error: 'src[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized] + +I assume this can never happen in practice, but adding a check here doesn't +hurt either and avoids the warning. The code has been unchanged since +the start of git history. + +Signed-off-by: Arnd Bergmann +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/au88x0/au88x0_core.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/sound/pci/au88x0/au88x0_core.c ++++ b/sound/pci/au88x0/au88x0_core.c +@@ -2279,6 +2279,9 @@ vortex_adb_allocroute(vortex_t *vortex, + } else { + int src[2], mix[2]; + ++ if (nr_ch < 1) ++ return -EINVAL; ++ + /* Get SRC and MIXER hardware resources. */ + for (i = 0; i < nr_ch; i++) { + if ((mix[i] = diff --git a/queue-4.4/arm-remove-duplicate-const-annotations.patch b/queue-4.4/arm-remove-duplicate-const-annotations.patch new file mode 100644 index 00000000000..0976cccc01d --- /dev/null +++ b/queue-4.4/arm-remove-duplicate-const-annotations.patch @@ -0,0 +1,113 @@ +From 0527873b29b077fc8e656acd63e1866b429fef55 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 11 May 2017 13:50:16 +0200 +Subject: ARM: remove duplicate 'const' annotations' +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Arnd Bergmann + +commit 0527873b29b077fc8e656acd63e1866b429fef55 upstream. + +gcc-7 warns about some declarations that are more 'const' than necessary: + +arch/arm/mach-at91/pm.c:338:34: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] + static const struct of_device_id const ramc_ids[] __initconst = { +arch/arm/mach-bcm/bcm_kona_smc.c:36:34: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] + static const struct of_device_id const bcm_kona_smc_ids[] __initconst = { +arch/arm/mach-spear/time.c:207:34: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] + static const struct of_device_id const timer_of_match[] __initconst = { +arch/arm/mach-omap2/prm_common.c:714:34: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] + static const struct of_device_id const omap_prcm_dt_match_table[] __initconst = { +arch/arm/mach-omap2/vc.c:562:35: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] + static const struct i2c_init_data const omap4_i2c_timing_data[] __initconst = { + +The ones in arch/arm were apparently all introduced accidentally by one +commit that correctly marked a lot of variables as __initconst. + +Fixes: 19c233b79d1a ("ARM: appropriate __init annotation for const data") +Acked-by: Alexandre Belloni +Acked-by: Tony Lindgren +Acked-by: Nicolas Pitre +Acked-by: Florian Fainelli +Acked-by: Viresh Kumar +Acked-by: Krzysztof Hałasa +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-at91/pm.c | 2 +- + arch/arm/mach-bcm/bcm_kona_smc.c | 2 +- + arch/arm/mach-cns3xxx/core.c | 2 +- + arch/arm/mach-omap2/prm_common.c | 2 +- + arch/arm/mach-omap2/vc.c | 2 +- + arch/arm/mach-spear/time.c | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + +--- a/arch/arm/mach-at91/pm.c ++++ b/arch/arm/mach-at91/pm.c +@@ -332,7 +332,7 @@ static void at91sam9_sdram_standby(void) + at91_ramc_write(1, AT91_SDRAMC_LPR, saved_lpr1); + } + +-static const struct of_device_id const ramc_ids[] __initconst = { ++static const struct of_device_id ramc_ids[] __initconst = { + { .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby }, + { .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby }, + { .compatible = "atmel,at91sam9g45-ddramc", .data = at91_ddr_standby }, +--- a/arch/arm/mach-bcm/bcm_kona_smc.c ++++ b/arch/arm/mach-bcm/bcm_kona_smc.c +@@ -33,7 +33,7 @@ struct bcm_kona_smc_data { + unsigned result; + }; + +-static const struct of_device_id const bcm_kona_smc_ids[] __initconst = { ++static const struct of_device_id bcm_kona_smc_ids[] __initconst = { + {.compatible = "brcm,kona-smc"}, + {.compatible = "bcm,kona-smc"}, /* deprecated name */ + {}, +--- a/arch/arm/mach-cns3xxx/core.c ++++ b/arch/arm/mach-cns3xxx/core.c +@@ -346,7 +346,7 @@ static struct usb_ohci_pdata cns3xxx_usb + .power_off = csn3xxx_usb_power_off, + }; + +-static const struct of_dev_auxdata const cns3xxx_auxdata[] __initconst = { ++static const struct of_dev_auxdata cns3xxx_auxdata[] __initconst = { + { "intel,usb-ehci", CNS3XXX_USB_BASE, "ehci-platform", &cns3xxx_usb_ehci_pdata }, + { "intel,usb-ohci", CNS3XXX_USB_OHCI_BASE, "ohci-platform", &cns3xxx_usb_ohci_pdata }, + { "cavium,cns3420-ahci", CNS3XXX_SATA2_BASE, "ahci", NULL }, +--- a/arch/arm/mach-omap2/prm_common.c ++++ b/arch/arm/mach-omap2/prm_common.c +@@ -706,7 +706,7 @@ static struct omap_prcm_init_data scrm_d + }; + #endif + +-static const struct of_device_id const omap_prcm_dt_match_table[] __initconst = { ++static const struct of_device_id omap_prcm_dt_match_table[] __initconst = { + #ifdef CONFIG_SOC_AM33XX + { .compatible = "ti,am3-prcm", .data = &am3_prm_data }, + #endif +--- a/arch/arm/mach-omap2/vc.c ++++ b/arch/arm/mach-omap2/vc.c +@@ -559,7 +559,7 @@ struct i2c_init_data { + u8 hsscll_12; + }; + +-static const struct i2c_init_data const omap4_i2c_timing_data[] __initconst = { ++static const struct i2c_init_data omap4_i2c_timing_data[] __initconst = { + { + .load = 50, + .loadbits = 0x3, +--- a/arch/arm/mach-spear/time.c ++++ b/arch/arm/mach-spear/time.c +@@ -204,7 +204,7 @@ static void __init spear_clockevent_init + setup_irq(irq, &spear_timer_irq); + } + +-static const struct of_device_id const timer_of_match[] __initconst = { ++static const struct of_device_id timer_of_match[] __initconst = { + { .compatible = "st,spear-timer", }, + { }, + }; diff --git a/queue-4.4/drivers-firmware-psci-drop-duplicate-const-from-psci_of_match.patch b/queue-4.4/drivers-firmware-psci-drop-duplicate-const-from-psci_of_match.patch new file mode 100644 index 00000000000..b9e8805ab63 --- /dev/null +++ b/queue-4.4/drivers-firmware-psci-drop-duplicate-const-from-psci_of_match.patch @@ -0,0 +1,32 @@ +From 1d2d8de44a6c20af262b4c3d3b93ef7ec3c5488e Mon Sep 17 00:00:00 2001 +From: Jisheng Zhang +Date: Wed, 20 Apr 2016 11:20:27 +0100 +Subject: drivers: firmware: psci: drop duplicate const from psci_of_match + +From: Jisheng Zhang + +commit 1d2d8de44a6c20af262b4c3d3b93ef7ec3c5488e upstream. + +This is to fix below sparse warning: +drivers/firmware/psci.c:mmm:nn: warning: duplicate const + +Signed-off-by: Jisheng Zhang +Signed-off-by: Lorenzo Pieralisi +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/firmware/psci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/firmware/psci.c ++++ b/drivers/firmware/psci.c +@@ -424,7 +424,7 @@ out_put_node: + return err; + } + +-static const struct of_device_id const psci_of_match[] __initconst = { ++static const struct of_device_id psci_of_match[] __initconst = { + { .compatible = "arm,psci", .data = psci_0_1_init}, + { .compatible = "arm,psci-0.2", .data = psci_0_2_init}, + { .compatible = "arm,psci-1.0", .data = psci_0_2_init}, diff --git a/queue-4.4/ib-qib-fix-false-postive-maybe-uninitialized-warning.patch b/queue-4.4/ib-qib-fix-false-postive-maybe-uninitialized-warning.patch new file mode 100644 index 00000000000..331a018da15 --- /dev/null +++ b/queue-4.4/ib-qib-fix-false-postive-maybe-uninitialized-warning.patch @@ -0,0 +1,39 @@ +From f6aafac184a3e46e919769dd4faa8bf0dc436534 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Tue, 14 Mar 2017 13:18:45 +0100 +Subject: IB/qib: fix false-postive maybe-uninitialized warning + +From: Arnd Bergmann + +commit f6aafac184a3e46e919769dd4faa8bf0dc436534 upstream. + +aarch64-linux-gcc-7 complains about code it doesn't fully understand: + +drivers/infiniband/hw/qib/qib_iba7322.c: In function 'qib_7322_txchk_change': +include/asm-generic/bitops/non-atomic.h:105:35: error: 'shadow' may be used uninitialized in this function [-Werror=maybe-uninitialized] + +The code is right, and despite trying hard, I could not come up with a version +that I liked better than just adding a fake initialization here to shut up the +warning. + +Fixes: f931551bafe1 ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters") +Signed-off-by: Arnd Bergmann +Acked-by: Ira Weiny +Signed-off-by: Doug Ledford +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/infiniband/hw/qib/qib_iba7322.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/infiniband/hw/qib/qib_iba7322.c ++++ b/drivers/infiniband/hw/qib/qib_iba7322.c +@@ -7097,7 +7097,7 @@ static void qib_7322_txchk_change(struct + unsigned long flags; + + while (wait) { +- unsigned long shadow; ++ unsigned long shadow = 0; + int cstart, previ = -1; + + /* diff --git a/queue-4.4/series b/queue-4.4/series index 18e80742a88..1b1fbf1a0ec 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -43,3 +43,8 @@ md-raid10-submit-bio-directly-to-replacement-disk.patch i2c-meson-fix-wrong-variable-usage-in-meson_i2c_put_data.patch xfs-remove-kmem_zalloc_greedy.patch libata-transport-remove-circular-dependency-at-free-time.patch +drivers-firmware-psci-drop-duplicate-const-from-psci_of_match.patch +ib-qib-fix-false-postive-maybe-uninitialized-warning.patch +arm-remove-duplicate-const-annotations.patch +alsa-au88x0-avoid-theoretical-uninitialized-access.patch +ttpci-address-stringop-overflow-warning.patch diff --git a/queue-4.4/ttpci-address-stringop-overflow-warning.patch b/queue-4.4/ttpci-address-stringop-overflow-warning.patch new file mode 100644 index 00000000000..07a08588a50 --- /dev/null +++ b/queue-4.4/ttpci-address-stringop-overflow-warning.patch @@ -0,0 +1,115 @@ +From 69d3973af1acd4c0989ec8218c05f12d303cd7cf Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 2 Feb 2017 12:51:28 -0200 +Subject: [media] ttpci: address stringop overflow warning + +From: Arnd Bergmann + +commit 69d3973af1acd4c0989ec8218c05f12d303cd7cf upstream. + +gcc-7.0.1 warns about old code in ttpci: + +In file included from drivers/media/pci/ttpci/av7110.c:63:0: +In function 'irdebi.isra.2', + inlined from 'start_debi_dma' at drivers/media/pci/ttpci/av7110.c:376:3, + inlined from 'gpioirq' at drivers/media/pci/ttpci/av7110.c:659:3: +drivers/media/pci/ttpci/av7110_hw.h:406:3: warning: 'memcpy': specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=] + memcpy(av7110->debi_virt, (char *) &res, count); +In function 'irdebi.isra.2', + inlined from 'start_debi_dma' at drivers/media/pci/ttpci/av7110.c:376:3, + inlined from 'gpioirq' at drivers/media/pci/ttpci/av7110.c:668:3: +drivers/media/pci/ttpci/av7110_hw.h:406:3: warning: 'memcpy': specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=] + memcpy(av7110->debi_virt, (char *) &res, count); + +Apparently, 'count' can be negative here, which will then get turned +into a giant size argument for memcpy. Changing the sizes to 'unsigned +int' instead seems safe as we already check for maximum sizes, and it +also simplifies the code a bit. + +Signed-off-by: Arnd Bergmann +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/pci/ttpci/av7110_hw.c | 8 ++++---- + drivers/media/pci/ttpci/av7110_hw.h | 12 ++++++------ + 2 files changed, 10 insertions(+), 10 deletions(-) + +--- a/drivers/media/pci/ttpci/av7110_hw.c ++++ b/drivers/media/pci/ttpci/av7110_hw.c +@@ -56,11 +56,11 @@ + by Nathan Laredo */ + + int av7110_debiwrite(struct av7110 *av7110, u32 config, +- int addr, u32 val, int count) ++ int addr, u32 val, unsigned int count) + { + struct saa7146_dev *dev = av7110->dev; + +- if (count <= 0 || count > 32764) { ++ if (count > 32764) { + printk("%s: invalid count %d\n", __func__, count); + return -1; + } +@@ -78,12 +78,12 @@ int av7110_debiwrite(struct av7110 *av71 + return 0; + } + +-u32 av7110_debiread(struct av7110 *av7110, u32 config, int addr, int count) ++u32 av7110_debiread(struct av7110 *av7110, u32 config, int addr, unsigned int count) + { + struct saa7146_dev *dev = av7110->dev; + u32 result = 0; + +- if (count > 32764 || count <= 0) { ++ if (count > 32764) { + printk("%s: invalid count %d\n", __func__, count); + return 0; + } +--- a/drivers/media/pci/ttpci/av7110_hw.h ++++ b/drivers/media/pci/ttpci/av7110_hw.h +@@ -377,14 +377,14 @@ extern int av7110_fw_request(struct av71 + + /* DEBI (saa7146 data extension bus interface) access */ + extern int av7110_debiwrite(struct av7110 *av7110, u32 config, +- int addr, u32 val, int count); ++ int addr, u32 val, unsigned int count); + extern u32 av7110_debiread(struct av7110 *av7110, u32 config, +- int addr, int count); ++ int addr, unsigned int count); + + + /* DEBI during interrupt */ + /* single word writes */ +-static inline void iwdebi(struct av7110 *av7110, u32 config, int addr, u32 val, int count) ++static inline void iwdebi(struct av7110 *av7110, u32 config, int addr, u32 val, unsigned int count) + { + av7110_debiwrite(av7110, config, addr, val, count); + } +@@ -397,7 +397,7 @@ static inline void mwdebi(struct av7110 + av7110_debiwrite(av7110, config, addr, 0, count); + } + +-static inline u32 irdebi(struct av7110 *av7110, u32 config, int addr, u32 val, int count) ++static inline u32 irdebi(struct av7110 *av7110, u32 config, int addr, u32 val, unsigned int count) + { + u32 res; + +@@ -408,7 +408,7 @@ static inline u32 irdebi(struct av7110 * + } + + /* DEBI outside interrupts, only for count <= 4! */ +-static inline void wdebi(struct av7110 *av7110, u32 config, int addr, u32 val, int count) ++static inline void wdebi(struct av7110 *av7110, u32 config, int addr, u32 val, unsigned int count) + { + unsigned long flags; + +@@ -417,7 +417,7 @@ static inline void wdebi(struct av7110 * + spin_unlock_irqrestore(&av7110->debilock, flags); + } + +-static inline u32 rdebi(struct av7110 *av7110, u32 config, int addr, u32 val, int count) ++static inline u32 rdebi(struct av7110 *av7110, u32 config, int addr, u32 val, unsigned int count) + { + unsigned long flags; + u32 res;