[PATCH AUTOSEL 4.14 37/57] staging: bcm2835-audio: Don't leak workqueue if open fails

2018-09-14 Thread Sasha Levin
From: Tuomas Tynkkynen [ Upstream commit 678c5b119307c40f9a17152512f9c949d0ec7292 ] Currently, if bcm2835_audio_open() fails partway, the allocated workqueue is leaked. Avoid that. While at it, propagate the return value of bcm2835_audio_open_connection() on failure instead of returning -1. Si

[PATCH AUTOSEL 4.14 33/57] sched/fair: Fix util_avg of new tasks for asymmetric systems

2018-09-14 Thread Sasha Levin
From: Quentin Perret [ Upstream commit 8fe5c5a937d0f4e84221631833a2718afde52285 ] When a new task wakes-up for the first time, its initial utilization is set to half of the spare capacity of its CPU. The current implementation of post_init_entity_util_avg() uses SCHED_CAPACITY_SCALE directly as

[PATCH AUTOSEL 4.14 41/57] input: rohm_bu21023: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT)

2018-09-14 Thread Sasha Levin
From: Peter Rosin [ Upstream commit 193c2a07cfaacb9249ab0e3d34bce32490879355 ] Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mu

[PATCH AUTOSEL 4.14 52/57] blk-mq: only attempt to merge bio if there is rq in sw queue

2018-09-14 Thread Sasha Levin
From: Ming Lei [ Upstream commit b04f50ab8a74129b3041a2836c33c916be3c6667 ] Only attempt to merge bio iff the ctx->rq_list isn't empty, because: 1) for high-performance SSD, most of times dispatch may succeed, then there may be nothing left in ctx->rq_list, so don't try to merge over sw queue i

[PATCH AUTOSEL 4.14 51/57] IB/nes: Fix a compiler warning

2018-09-14 Thread Sasha Levin
From: Bart Van Assche [ Upstream commit 4c5743bc4fe3233cecc1c184a773c79c8ee45bbe ] Avoid that the following compiler warning is reported when building with W=1: drivers/infiniband/hw/nes/nes_hw.c:646:51: warning: suggest braces around empty body in an 'if' statement [-Wempty-body] Signed-off-

[PATCH AUTOSEL 4.14 39/57] gpiolib: Mark gpio_suffixes array with __maybe_unused

2018-09-14 Thread Sasha Levin
From: Andy Shevchenko [ Upstream commit b23ec59926faf05b0c43680d05671c484e810ac4 ] Since we put static variable to a header file it's copied to each module that includes the header. But not all of them are actually used it. Mark gpio_suffixes array with __maybe_unused to hide a compiler warning

[PATCH AUTOSEL 4.14 40/57] mfd: 88pm860x-i2c: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT)

2018-09-14 Thread Sasha Levin
From: Peter Rosin [ Upstream commit 8c8f74f327a76604a499fad8c54c15e1c0ee8051 ] Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mu

[PATCH AUTOSEL 4.14 38/57] gpio: pxa: Fix potential NULL dereference

2018-09-14 Thread Sasha Levin
From: Wei Yongjun [ Upstream commit 9506755633d0b32ef76f67c345000178e9b0dfc4 ] platform_get_resource() may fail and return NULL, so we should better check it's return value to avoid a NULL pointer dereference a bit later in the code. This is detected by Coccinelle semantic patch. @@ expression

[PATCH AUTOSEL 4.14 48/57] drm/panel: type promotion bug in s6e8aa0_read_mtp_id()

2018-09-14 Thread Sasha Levin
From: Dan Carpenter [ Upstream commit cd0e0ca69109d025b1a1b6609f70682db62138b0 ] The ARRAY_SIZE() macro is type size_t. If s6e8aa0_dcs_read() returns a negative error code, then "ret < ARRAY_SIZE(id)" is false because the negative error code is type promoted to a high positive value. Fixes: 02

[PATCH AUTOSEL 4.14 43/57] drm/amdkfd: Fix error codes in kfd_get_process

2018-09-14 Thread Sasha Levin
From: Wei Lu [ Upstream commit e47cb828eb3fca3e8999a0b9aa053dda18552071 ] Return ERR_PTR(-EINVAL) if kfd_get_process fails to find the process. This fixes kernel oopses when a child process calls KFD ioctls with a file descriptor inherited from the parent process. Signed-off-by: Wei Lu Reviewe

[PATCH AUTOSEL 4.9 01/34] binfmt_elf: Respect error return from `regset->active'

2018-09-14 Thread Sasha Levin
From: "Maciej W. Rozycki" [ Upstream commit 2f819db565e82e5f73cd42b39925098986693378 ] The regset API documented in defines -ENODEV as the result of the `->active' handler to be used where the feature requested is not available on the hardware found. However code handling core file note genera

[PATCH AUTOSEL 4.14 45/57] ALSA: pcm: Fix snd_interval_refine first/last with open min/max

2018-09-14 Thread Sasha Levin
From: Timo Wischer [ Upstream commit ff2d6acdf6f13d9f8fdcd890844c6d7535ac1f10 ] Without this commit the following intervals [x y), (x y) were be replaced to (y-1 y) by snd_interval_refine_last(). This was also done if y-1 is part of the previous interval. With this changes it will be replaced wi

[PATCH AUTOSEL 4.14 44/57] rtc: bq4802: add error handling for devm_ioremap

2018-09-14 Thread Sasha Levin
From: Zhouyang Jia [ Upstream commit 7874b919866ba91bac253fa219d3d4c82bb944df ] When devm_ioremap fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling devm_ioremap. Signed-off-by: Zhouyang Jia Signed-off-by: Alexandre Belloni

[PATCH AUTOSEL 4.14 54/57] gpiolib: Respect error code of ->get_direction()

2018-09-14 Thread Sasha Levin
From: Andy Shevchenko [ Upstream commit 36b312792b97933dc07abe074f50941199bd357c ] In case we try to lock GPIO pin as IRQ when something going wrong we print a misleading message. Correct this by checking an error code from ->get_direction() in gpiochip_lock_as_irq() and printing a correspondin

[PATCH AUTOSEL 4.9 02/34] audit: fix use-after-free in audit_add_watch

2018-09-14 Thread Sasha Levin
From: Ronny Chevalier [ Upstream commit baa2a4fdd525c8c4b0f704d20457195b29437839 ] audit_add_watch stores locally krule->watch without taking a reference on watch. Then, it calls audit_add_to_parent, and uses the watch stored locally. Unfortunately, it is possible that audit_add_to_parent updat

[PATCH AUTOSEL 4.9 08/34] configfs: fix registered group removal

2018-09-14 Thread Sasha Levin
From: Mike Christie [ Upstream commit cc57c07343bd071cdf1915a91a24ab7d40c9b590 ] This patch fixes a bug where configfs_register_group had added a group in a tree, and userspace has done a rmdir on a dir somewhere above that group and we hit a kernel crash. The problem is configfs_rmdir will deta

[PATCH AUTOSEL 4.9 15/34] mmc: sdhci: do not try to use 3.3V signaling if not supported

2018-09-14 Thread Sasha Levin
From: Stefan Agner [ Upstream commit 1b5190c2e74c47ebe4bcecf7a072358ad9f1feaa ] For eMMC devices it is valid to only support 1.8V signaling. When vqmmc is set to a fixed 1.8V regulator the stack tries to set 3.3V initially and prints the following warning: mmc1: Switching to 3.3V signalling v

[PATCH AUTOSEL 4.9 13/34] gpu: ipu-v3: csi: pass back mbus_code_to_bus_cfg error codes

2018-09-14 Thread Sasha Levin
From: Enrico Scholz [ Upstream commit d36d0e6309dd8137cf438cbb680e72eb63c81425 ] mbus_code_to_bus_cfg() can fail on unknown mbus codes; pass back the error to the caller. Signed-off-by: Enrico Scholz Signed-off-by: Jan Luebbe [p.za...@pengutronix.de - renamed rc to ret for consistency] Signed

[PATCH AUTOSEL 4.9 14/34] mmc: tegra: prevent HS200 on Tegra 3

2018-09-14 Thread Sasha Levin
From: Stefan Agner [ Upstream commit 127407e36f4fe3a1d5e8b9998b479956ce83a7dc ] The stack assumes that SDHC controller which support SD3.0 (SDR104) do support HS200. This is not the case for Tegra 3, which does support SD 3.0 but only supports eMMC spec 4.41. Use SDHCI_QUIRK2_BROKEN_HS200 to in

[PATCH AUTOSEL 4.9 06/34] PM / devfreq: use put_device() instead of kfree()

2018-09-14 Thread Sasha Levin
From: Arvind Yadav [ Upstream commit 2d803dc8f7a5f622ac47c3b650834ada3a2659b9 ] Never directly free @dev after calling device_register() or device_unregister(), even if device_register() returned an error. Always use put_device() to give up the reference initialized. Signed-off-by: Arvind Yadav

[PATCH AUTOSEL 4.9 07/34] MIPS: loongson64: cs5536: Fix PCI_OHCI_INT_REG reads

2018-09-14 Thread Sasha Levin
From: Paul Burton [ Upstream commit cd87668d601f622e0ebcfea4f78d116d5f572f4d ] The PCI_OHCI_INT_REG case in pci_ohci_read_reg() contains the following if statement: if ((lo & 0x0f00) == CS5536_USB_INTR) CS5536_USB_INTR expands to the constant 11, which gives us the following condition wh

[PATCH AUTOSEL 4.9 10/34] ARM: hisi: handle of_iomap and fix missing of_node_put

2018-09-14 Thread Sasha Levin
From: Nicholas Mc Guire [ Upstream commit d396cb185c0337aae5664b250cdd9a73f6eb1503 ] Relying on an unchecked of_iomap() which can return NULL is problematic here, an explicit check seems mandatory. Also the call to of_find_compatible_node() returns a device node with refcount incremented therefo

[PATCH AUTOSEL 4.9 16/34] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping

2018-09-14 Thread Sasha Levin
From: Thierry Reding [ Upstream commit b59fb482b52269977ee5de205308e5b236a03917 ] Depending on the kernel configuration, early ARM architecture setup code may have attached the GPU to a DMA/IOMMU mapping that transparently uses the IOMMU to back the DMA API. Tegra requires special handling for I

[PATCH AUTOSEL 4.9 11/34] ARM: hisi: fix error handling and missing of_node_put

2018-09-14 Thread Sasha Levin
From: Nicholas Mc Guire [ Upstream commit 9f30b5ae0585ca5234fe979294b8f897299dec99 ] of_iomap() can return NULL which seems critical here and thus should be explicitly flagged so that the cause of system halting can be understood. As of_find_compatible_node() is returning a device node with refc

[PATCH AUTOSEL 4.9 12/34] ARM: hisi: check of_iomap and fix missing of_node_put

2018-09-14 Thread Sasha Levin
From: Nicholas Mc Guire [ Upstream commit 81646a3d39ef14749301374a3a0b8311384cd412 ] of_find_compatible_node() returns a device node with refcount incremented and thus needs an explicit of_node_put(). Further relying on an unchecked of_iomap() which can return NULL is problematic here, after all

Re: [PATCH AUTOSEL 4.18 51/92] tools/testing/nvdimm: Fix support for emulating controller temperature

2018-09-14 Thread Sasha Levin
On Fri, Sep 14, 2018 at 06:34:43PM -0700, Dan Williams wrote: >On Fri, Sep 14, 2018 at 6:30 PM, Sasha Levin > wrote: >> From: Dan Williams >> >> [ Upstream commit e5d772fbe7685aae0dff99f3b54158a0ec32155e ] >> >> In addition to populating the value the payload also needs to set the >> "controller t

[PATCH AUTOSEL 4.9 18/34] coresight: Handle errors in finding input/output ports

2018-09-14 Thread Sasha Levin
From: Suzuki K Poulose [ Upstream commit fe470f5f7f684ed15bc49b6183a64237547910ff ] If we fail to find the input / output port for a LINK component while enabling a path, we should fail gracefully rather than assuming port "0". Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by

[PATCH AUTOSEL 4.9 17/34] parport: sunbpp: fix error return code

2018-09-14 Thread Sasha Levin
From: Julia Lawall [ Upstream commit faa1a47388b33623e4d504c23569188907b039a0 ] Return an error code on failure. Change leading spaces to tab on the first if. Problem found using Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman Signed

[PATCH AUTOSEL 4.9 21/34] gpiolib: Mark gpio_suffixes array with __maybe_unused

2018-09-14 Thread Sasha Levin
From: Andy Shevchenko [ Upstream commit b23ec59926faf05b0c43680d05671c484e810ac4 ] Since we put static variable to a header file it's copied to each module that includes the header. But not all of them are actually used it. Mark gpio_suffixes array with __maybe_unused to hide a compiler warning

[PATCH AUTOSEL 4.9 24/34] rcu: Fix grace-period hangs due to race with CPU offline

2018-09-14 Thread Sasha Levin
From: "Paul E. McKenney" [ Upstream commit 1e64b15a4b102e1cd059d4d798b7a78f93341333 ] Without special fail-safe quiescent-state-propagation checks, grace-period hangs can result from the following scenario: 1. CPU 1 goes offline. 2. Because CPU 1 is the only CPU in the system blockin

Re: [PATCH AUTOSEL 4.18 51/92] tools/testing/nvdimm: Fix support for emulating controller temperature

2018-09-14 Thread Dan Williams
On Fri, Sep 14, 2018 at 6:30 PM, Sasha Levin wrote: > From: Dan Williams > > [ Upstream commit e5d772fbe7685aae0dff99f3b54158a0ec32155e ] > > In addition to populating the value the payload also needs to set the > "controller temperature valid" flag. > > Fixes: cdd77d3e1930 ("nfit, libnvdimm: dep

[PATCH AUTOSEL 4.9 19/34] coresight: tpiu: Fix disabling timeouts

2018-09-14 Thread Sasha Levin
From: Robin Murphy [ Upstream commit ccff2dfaceaca4517432f5c149594215fe9098cc ] Probing the TPIU driver under UBSan triggers an out-of-bounds shift warning in coresight_timeout(): ... [5.677530] UBSAN: Undefined behaviour in drivers/hwtracing/coresight/coresight.c:929:16 [5.685542] shi

[PATCH AUTOSEL 4.9 23/34] input: rohm_bu21023: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT)

2018-09-14 Thread Sasha Levin
From: Peter Rosin [ Upstream commit 193c2a07cfaacb9249ab0e3d34bce32490879355 ] Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mu

[PATCH AUTOSEL 4.9 31/34] dmaengine: idma64: Support dmaengine_terminate_sync()

2018-09-14 Thread Sasha Levin
From: Andy Shevchenko [ Upstream commit bbacb8e78a3b29ebdbb6af7d54fcf25d3f1c248f ] It appears that the driver misses the support of dmaengine_terminate_sync(). Since many of callers expects this behaviour implement the new device_synchronize() callback to allow proper synchronization when stoppi

[PATCH AUTOSEL 4.9 33/34] gpiolib: Respect error code of ->get_direction()

2018-09-14 Thread Sasha Levin
From: Andy Shevchenko [ Upstream commit 36b312792b97933dc07abe074f50941199bd357c ] In case we try to lock GPIO pin as IRQ when something going wrong we print a misleading message. Correct this by checking an error code from ->get_direction() in gpiochip_lock_as_irq() and printing a correspondin

[PATCH AUTOSEL 4.9 32/34] IB/nes: Fix a compiler warning

2018-09-14 Thread Sasha Levin
From: Bart Van Assche [ Upstream commit 4c5743bc4fe3233cecc1c184a773c79c8ee45bbe ] Avoid that the following compiler warning is reported when building with W=1: drivers/infiniband/hw/nes/nes_hw.c:646:51: warning: suggest braces around empty body in an 'if' statement [-Wempty-body] Signed-off-

[PATCH AUTOSEL 4.4 04/20] mtd: rawnand: sunxi: Add an U suffix to NFC_PAGE_OP definition

2018-09-14 Thread Sasha Levin
From: Boris Brezillon [ Upstream commit cf3e3fd2e94f4648f17fbd5e0e26409d5d1face9 ] Fixes the "warning: large integer implicitly truncated to unsigned type [-Woverflow]" warning when compiled for x86. This is needed in order to allow compiling this driver when COMPILE_TEST=y. Reported-by: Steph

[PATCH AUTOSEL 4.9 34/34] pinctrl: qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant

2018-09-14 Thread Sasha Levin
From: Douglas Anderson [ Upstream commit 1cf86bc21257a330e3af51f2a4e885f1a705f6a5 ] If you do this on an sdm845 board: grep "" /sys/kernel/debug/pinctrl/*spmi:pmic*/pinconf-groups ...it looks like nonsense. For every pin you see listed: input bias disabled, input bias high impedance, input

[PATCH AUTOSEL 4.4 03/20] mtdchar: fix overflows in adjustment of `count`

2018-09-14 Thread Sasha Levin
From: Jann Horn [ Upstream commit 6c6bc9ea84d0008024606bf5ba10519e20d851bf ] The first checks in mtdchar_read() and mtdchar_write() attempt to limit `count` such that `*ppos + count <= mtd->size`. However, they ignore the possibility of `*ppos > mtd->size`, allowing the calculation of `count` to

[PATCH AUTOSEL 4.4 05/20] MIPS: loongson64: cs5536: Fix PCI_OHCI_INT_REG reads

2018-09-14 Thread Sasha Levin
From: Paul Burton [ Upstream commit cd87668d601f622e0ebcfea4f78d116d5f572f4d ] The PCI_OHCI_INT_REG case in pci_ohci_read_reg() contains the following if statement: if ((lo & 0x0f00) == CS5536_USB_INTR) CS5536_USB_INTR expands to the constant 11, which gives us the following condition wh

[PATCH AUTOSEL 4.4 02/20] audit: fix use-after-free in audit_add_watch

2018-09-14 Thread Sasha Levin
From: Ronny Chevalier [ Upstream commit baa2a4fdd525c8c4b0f704d20457195b29437839 ] audit_add_watch stores locally krule->watch without taking a reference on watch. Then, it calls audit_add_to_parent, and uses the watch stored locally. Unfortunately, it is possible that audit_add_to_parent updat

[PATCH AUTOSEL 4.4 07/20] ARM: hisi: fix error handling and missing of_node_put

2018-09-14 Thread Sasha Levin
From: Nicholas Mc Guire [ Upstream commit 9f30b5ae0585ca5234fe979294b8f897299dec99 ] of_iomap() can return NULL which seems critical here and thus should be explicitly flagged so that the cause of system halting can be understood. As of_find_compatible_node() is returning a device node with refc

[PATCH AUTOSEL 4.4 01/20] binfmt_elf: Respect error return from `regset->active'

2018-09-14 Thread Sasha Levin
From: "Maciej W. Rozycki" [ Upstream commit 2f819db565e82e5f73cd42b39925098986693378 ] The regset API documented in defines -ENODEV as the result of the `->active' handler to be used where the feature requested is not available on the hardware found. However code handling core file note genera

[PATCH AUTOSEL 4.4 06/20] ARM: hisi: handle of_iomap and fix missing of_node_put

2018-09-14 Thread Sasha Levin
From: Nicholas Mc Guire [ Upstream commit d396cb185c0337aae5664b250cdd9a73f6eb1503 ] Relying on an unchecked of_iomap() which can return NULL is problematic here, an explicit check seems mandatory. Also the call to of_find_compatible_node() returns a device node with refcount incremented therefo

[PATCH AUTOSEL 4.4 11/20] coresight: Handle errors in finding input/output ports

2018-09-14 Thread Sasha Levin
From: Suzuki K Poulose [ Upstream commit fe470f5f7f684ed15bc49b6183a64237547910ff ] If we fail to find the input / output port for a LINK component while enabling a path, we should fail gracefully rather than assuming port "0". Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by

[PATCH AUTOSEL 4.4 19/20] IB/nes: Fix a compiler warning

2018-09-14 Thread Sasha Levin
From: Bart Van Assche [ Upstream commit 4c5743bc4fe3233cecc1c184a773c79c8ee45bbe ] Avoid that the following compiler warning is reported when building with W=1: drivers/infiniband/hw/nes/nes_hw.c:646:51: warning: suggest braces around empty body in an 'if' statement [-Wempty-body] Signed-off-

[PATCH AUTOSEL 3.18 01/11] binfmt_elf: Respect error return from `regset->active'

2018-09-14 Thread Sasha Levin
From: "Maciej W. Rozycki" [ Upstream commit 2f819db565e82e5f73cd42b39925098986693378 ] The regset API documented in defines -ENODEV as the result of the `->active' handler to be used where the feature requested is not available on the hardware found. However code handling core file note genera

[PATCH AUTOSEL 4.4 10/20] parport: sunbpp: fix error return code

2018-09-14 Thread Sasha Levin
From: Julia Lawall [ Upstream commit faa1a47388b33623e4d504c23569188907b039a0 ] Return an error code on failure. Change leading spaces to tab on the first if. Problem found using Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman Signed

[PATCH AUTOSEL 4.4 09/20] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping

2018-09-14 Thread Sasha Levin
From: Thierry Reding [ Upstream commit b59fb482b52269977ee5de205308e5b236a03917 ] Depending on the kernel configuration, early ARM architecture setup code may have attached the GPU to a DMA/IOMMU mapping that transparently uses the IOMMU to back the DMA API. Tegra requires special handling for I

[PATCH AUTOSEL 4.4 14/20] drm/amdkfd: Fix error codes in kfd_get_process

2018-09-14 Thread Sasha Levin
From: Wei Lu [ Upstream commit e47cb828eb3fca3e8999a0b9aa053dda18552071 ] Return ERR_PTR(-EINVAL) if kfd_get_process fails to find the process. This fixes kernel oopses when a child process calls KFD ioctls with a file descriptor inherited from the parent process. Signed-off-by: Wei Lu Reviewe

[PATCH AUTOSEL 4.4 12/20] coresight: tpiu: Fix disabling timeouts

2018-09-14 Thread Sasha Levin
From: Robin Murphy [ Upstream commit ccff2dfaceaca4517432f5c149594215fe9098cc ] Probing the TPIU driver under UBSan triggers an out-of-bounds shift warning in coresight_timeout(): ... [5.677530] UBSAN: Undefined behaviour in drivers/hwtracing/coresight/coresight.c:929:16 [5.685542] shi

[PATCH AUTOSEL 4.4 13/20] gpiolib: Mark gpio_suffixes array with __maybe_unused

2018-09-14 Thread Sasha Levin
From: Andy Shevchenko [ Upstream commit b23ec59926faf05b0c43680d05671c484e810ac4 ] Since we put static variable to a header file it's copied to each module that includes the header. But not all of them are actually used it. Mark gpio_suffixes array with __maybe_unused to hide a compiler warning

[PATCH AUTOSEL 4.4 15/20] rtc: bq4802: add error handling for devm_ioremap

2018-09-14 Thread Sasha Levin
From: Zhouyang Jia [ Upstream commit 7874b919866ba91bac253fa219d3d4c82bb944df ] When devm_ioremap fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling devm_ioremap. Signed-off-by: Zhouyang Jia Signed-off-by: Alexandre Belloni

[PATCH AUTOSEL 3.18 02/11] audit: fix use-after-free in audit_add_watch

2018-09-14 Thread Sasha Levin
From: Ronny Chevalier [ Upstream commit baa2a4fdd525c8c4b0f704d20457195b29437839 ] audit_add_watch stores locally krule->watch without taking a reference on watch. Then, it calls audit_add_to_parent, and uses the watch stored locally. Unfortunately, it is possible that audit_add_to_parent updat

[PATCH AUTOSEL 3.18 04/11] MIPS: loongson64: cs5536: Fix PCI_OHCI_INT_REG reads

2018-09-14 Thread Sasha Levin
From: Paul Burton [ Upstream commit cd87668d601f622e0ebcfea4f78d116d5f572f4d ] The PCI_OHCI_INT_REG case in pci_ohci_read_reg() contains the following if statement: if ((lo & 0x0f00) == CS5536_USB_INTR) CS5536_USB_INTR expands to the constant 11, which gives us the following condition wh

[PATCH AUTOSEL 4.4 16/20] ALSA: pcm: Fix snd_interval_refine first/last with open min/max

2018-09-14 Thread Sasha Levin
From: Timo Wischer [ Upstream commit ff2d6acdf6f13d9f8fdcd890844c6d7535ac1f10 ] Without this commit the following intervals [x y), (x y) were be replaced to (y-1 y) by snd_interval_refine_last(). This was also done if y-1 is part of the previous interval. With this changes it will be replaced wi

[PATCH AUTOSEL 3.18 09/11] ALSA: pcm: Fix snd_interval_refine first/last with open min/max

2018-09-14 Thread Sasha Levin
From: Timo Wischer [ Upstream commit ff2d6acdf6f13d9f8fdcd890844c6d7535ac1f10 ] Without this commit the following intervals [x y), (x y) were be replaced to (y-1 y) by snd_interval_refine_last(). This was also done if y-1 is part of the previous interval. With this changes it will be replaced wi

[PATCH AUTOSEL 3.18 05/11] ARM: hisi: handle of_iomap and fix missing of_node_put

2018-09-14 Thread Sasha Levin
From: Nicholas Mc Guire [ Upstream commit d396cb185c0337aae5664b250cdd9a73f6eb1503 ] Relying on an unchecked of_iomap() which can return NULL is problematic here, an explicit check seems mandatory. Also the call to of_find_compatible_node() returns a device node with refcount incremented therefo

[PATCH AUTOSEL 3.18 06/11] ARM: hisi: check of_iomap and fix missing of_node_put

2018-09-14 Thread Sasha Levin
From: Nicholas Mc Guire [ Upstream commit 81646a3d39ef14749301374a3a0b8311384cd412 ] of_find_compatible_node() returns a device node with refcount incremented and thus needs an explicit of_node_put(). Further relying on an unchecked of_iomap() which can return NULL is problematic here, after all

[PATCH AUTOSEL 3.18 07/11] parport: sunbpp: fix error return code

2018-09-14 Thread Sasha Levin
From: Julia Lawall [ Upstream commit faa1a47388b33623e4d504c23569188907b039a0 ] Return an error code on failure. Change leading spaces to tab on the first if. Problem found using Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman Signed

[PATCH AUTOSEL 3.18 08/11] rtc: bq4802: add error handling for devm_ioremap

2018-09-14 Thread Sasha Levin
From: Zhouyang Jia [ Upstream commit 7874b919866ba91bac253fa219d3d4c82bb944df ] When devm_ioremap fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling devm_ioremap. Signed-off-by: Zhouyang Jia Signed-off-by: Alexandre Belloni

[PATCH AUTOSEL 3.18 11/11] IB/nes: Fix a compiler warning

2018-09-14 Thread Sasha Levin
From: Bart Van Assche [ Upstream commit 4c5743bc4fe3233cecc1c184a773c79c8ee45bbe ] Avoid that the following compiler warning is reported when building with W=1: drivers/infiniband/hw/nes/nes_hw.c:646:51: warning: suggest braces around empty body in an 'if' statement [-Wempty-body] Signed-off-

[PATCH AUTOSEL 3.18 10/11] drm/panel: type promotion bug in s6e8aa0_read_mtp_id()

2018-09-14 Thread Sasha Levin
From: Dan Carpenter [ Upstream commit cd0e0ca69109d025b1a1b6609f70682db62138b0 ] The ARRAY_SIZE() macro is type size_t. If s6e8aa0_dcs_read() returns a negative error code, then "ret < ARRAY_SIZE(id)" is false because the negative error code is type promoted to a high positive value. Fixes: 02

[PATCH AUTOSEL 3.18 03/11] mtdchar: fix overflows in adjustment of `count`

2018-09-14 Thread Sasha Levin
From: Jann Horn [ Upstream commit 6c6bc9ea84d0008024606bf5ba10519e20d851bf ] The first checks in mtdchar_read() and mtdchar_write() attempt to limit `count` such that `*ppos + count <= mtd->size`. However, they ignore the possibility of `*ppos > mtd->size`, allowing the calculation of `count` to

[PATCH AUTOSEL 4.4 08/20] ARM: hisi: check of_iomap and fix missing of_node_put

2018-09-14 Thread Sasha Levin
From: Nicholas Mc Guire [ Upstream commit 81646a3d39ef14749301374a3a0b8311384cd412 ] of_find_compatible_node() returns a device node with refcount incremented and thus needs an explicit of_node_put(). Further relying on an unchecked of_iomap() which can return NULL is problematic here, after all

[PATCH AUTOSEL 4.4 20/20] pinctrl: qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant

2018-09-14 Thread Sasha Levin
From: Douglas Anderson [ Upstream commit 1cf86bc21257a330e3af51f2a4e885f1a705f6a5 ] If you do this on an sdm845 board: grep "" /sys/kernel/debug/pinctrl/*spmi:pmic*/pinconf-groups ...it looks like nonsense. For every pin you see listed: input bias disabled, input bias high impedance, input

[PATCH AUTOSEL 4.9 27/34] ALSA: pcm: Fix snd_interval_refine first/last with open min/max

2018-09-14 Thread Sasha Levin
From: Timo Wischer [ Upstream commit ff2d6acdf6f13d9f8fdcd890844c6d7535ac1f10 ] Without this commit the following intervals [x y), (x y) were be replaced to (y-1 y) by snd_interval_refine_last(). This was also done if y-1 is part of the previous interval. With this changes it will be replaced wi

[PATCH AUTOSEL 4.4 18/20] drm/panel: type promotion bug in s6e8aa0_read_mtp_id()

2018-09-14 Thread Sasha Levin
From: Dan Carpenter [ Upstream commit cd0e0ca69109d025b1a1b6609f70682db62138b0 ] The ARRAY_SIZE() macro is type size_t. If s6e8aa0_dcs_read() returns a negative error code, then "ret < ARRAY_SIZE(id)" is false because the negative error code is type promoted to a high positive value. Fixes: 02

[PATCH AUTOSEL 4.9 29/34] drm/panel: type promotion bug in s6e8aa0_read_mtp_id()

2018-09-14 Thread Sasha Levin
From: Dan Carpenter [ Upstream commit cd0e0ca69109d025b1a1b6609f70682db62138b0 ] The ARRAY_SIZE() macro is type size_t. If s6e8aa0_dcs_read() returns a negative error code, then "ret < ARRAY_SIZE(id)" is false because the negative error code is type promoted to a high positive value. Fixes: 02

[PATCH AUTOSEL 4.9 26/34] rtc: bq4802: add error handling for devm_ioremap

2018-09-14 Thread Sasha Levin
From: Zhouyang Jia [ Upstream commit 7874b919866ba91bac253fa219d3d4c82bb944df ] When devm_ioremap fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling devm_ioremap. Signed-off-by: Zhouyang Jia Signed-off-by: Alexandre Belloni

[PATCH AUTOSEL 4.4 17/20] selftest: timers: Tweak raw_skew to SKIP when ADJ_OFFSET/other clock adjustments are in progress

2018-09-14 Thread Sasha Levin
From: John Stultz [ Upstream commit 1416270f4a1ae83ea84156ceba19a66a8f88be1f ] In the past we've warned when ADJ_OFFSET was in progress, usually caused by ntpd or some other time adjusting daemon running in non steady sate, which can cause the skew calculations to be incorrect. Thus, this patch

[PATCH AUTOSEL 4.9 20/34] gpio: pxa: Fix potential NULL dereference

2018-09-14 Thread Sasha Levin
From: Wei Yongjun [ Upstream commit 9506755633d0b32ef76f67c345000178e9b0dfc4 ] platform_get_resource() may fail and return NULL, so we should better check it's return value to avoid a NULL pointer dereference a bit later in the code. This is detected by Coccinelle semantic patch. @@ expression

[PATCH AUTOSEL 4.9 30/34] dmaengine: hsu: Support dmaengine_terminate_sync()

2018-09-14 Thread Sasha Levin
From: Andy Shevchenko [ Upstream commit 2abc66cd499aa16876e45c6438788902f7d1ce22 ] It appears that the driver misses the support of dmaengine_terminate_sync(). Since many of callers expects this behaviour implement the new device_synchronize() callback to allow proper synchronization when stoppi

[PATCH AUTOSEL 4.9 22/34] mfd: 88pm860x-i2c: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT)

2018-09-14 Thread Sasha Levin
From: Peter Rosin [ Upstream commit 8c8f74f327a76604a499fad8c54c15e1c0ee8051 ] Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mu

[PATCH AUTOSEL 4.9 28/34] selftest: timers: Tweak raw_skew to SKIP when ADJ_OFFSET/other clock adjustments are in progress

2018-09-14 Thread Sasha Levin
From: John Stultz [ Upstream commit 1416270f4a1ae83ea84156ceba19a66a8f88be1f ] In the past we've warned when ADJ_OFFSET was in progress, usually caused by ntpd or some other time adjusting daemon running in non steady sate, which can cause the skew calculations to be incorrect. Thus, this patch

[PATCH AUTOSEL 4.9 03/34] mtdchar: fix overflows in adjustment of `count`

2018-09-14 Thread Sasha Levin
From: Jann Horn [ Upstream commit 6c6bc9ea84d0008024606bf5ba10519e20d851bf ] The first checks in mtdchar_read() and mtdchar_write() attempt to limit `count` such that `*ppos + count <= mtd->size`. However, they ignore the possibility of `*ppos > mtd->size`, allowing the calculation of `count` to

[PATCH AUTOSEL 4.14 57/57] clk: tegra: bpmp: Don't crash when a clock fails to register

2018-09-14 Thread Sasha Levin
From: Mikko Perttunen [ Upstream commit f7b3182232c82bb9769e2d5471d702bae2972d2b ] When registering clocks, we just skip any that fail to register (leaving a NULL hole in the clock table). However, our of_xlate function still tries to dereference each entry while looking for the clock with the r

[PATCH AUTOSEL 4.9 05/34] evm: Don't deadlock if a crypto algorithm is unavailable

2018-09-14 Thread Sasha Levin
From: Matthew Garrett [ Upstream commit e2861fa71641c6414831d628a1f4f793b6562580 ] When EVM attempts to appraise a file signed with a crypto algorithm the kernel doesn't have support for, it will cause the kernel to trigger a module load. If the EVM policy includes appraisal of kernel modules th

[PATCH AUTOSEL 4.14 56/57] pinctrl: qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant

2018-09-14 Thread Sasha Levin
From: Douglas Anderson [ Upstream commit 1cf86bc21257a330e3af51f2a4e885f1a705f6a5 ] If you do this on an sdm845 board: grep "" /sys/kernel/debug/pinctrl/*spmi:pmic*/pinconf-groups ...it looks like nonsense. For every pin you see listed: input bias disabled, input bias high impedance, input

[PATCH AUTOSEL 4.9 04/34] mtd: rawnand: sunxi: Add an U suffix to NFC_PAGE_OP definition

2018-09-14 Thread Sasha Levin
From: Boris Brezillon [ Upstream commit cf3e3fd2e94f4648f17fbd5e0e26409d5d1face9 ] Fixes the "warning: large integer implicitly truncated to unsigned type [-Woverflow]" warning when compiled for x86. This is needed in order to allow compiling this driver when COMPILE_TEST=y. Reported-by: Steph

[PATCH AUTOSEL 4.14 50/57] dmaengine: idma64: Support dmaengine_terminate_sync()

2018-09-14 Thread Sasha Levin
From: Andy Shevchenko [ Upstream commit bbacb8e78a3b29ebdbb6af7d54fcf25d3f1c248f ] It appears that the driver misses the support of dmaengine_terminate_sync(). Since many of callers expects this behaviour implement the new device_synchronize() callback to allow proper synchronization when stoppi

[PATCH AUTOSEL 4.9 25/34] drm/amdkfd: Fix error codes in kfd_get_process

2018-09-14 Thread Sasha Levin
From: Wei Lu [ Upstream commit e47cb828eb3fca3e8999a0b9aa053dda18552071 ] Return ERR_PTR(-EINVAL) if kfd_get_process fails to find the process. This fixes kernel oopses when a child process calls KFD ioctls with a file descriptor inherited from the parent process. Signed-off-by: Wei Lu Reviewe

[PATCH AUTOSEL 4.14 55/57] pinctrl: msm: Fix msm_config_group_get() to be compliant

2018-09-14 Thread Sasha Levin
From: Douglas Anderson [ Upstream commit 05e0c828955c1cab58dd71a04539442e5375d917 ] If you do this on an sdm845 board: cat /sys/kernel/debug/pinctrl/340.pinctrl/pinconf-groups ...it looks like nonsense. For every pin you see listed: input bias bus hold, input bias disabled, input bias

[PATCH AUTOSEL 4.14 42/57] rcu: Fix grace-period hangs due to race with CPU offline

2018-09-14 Thread Sasha Levin
From: "Paul E. McKenney" [ Upstream commit 1e64b15a4b102e1cd059d4d798b7a78f93341333 ] Without special fail-safe quiescent-state-propagation checks, grace-period hangs can result from the following scenario: 1. CPU 1 goes offline. 2. Because CPU 1 is the only CPU in the system blockin

[PATCH AUTOSEL 4.14 46/57] scsi: libfc: fixup 'sleeping function called from invalid context'

2018-09-14 Thread Sasha Levin
From: Hannes Reinecke [ Upstream commit fa519f701d27198a2858bb108fc18ea9d8c106a7 ] fc_rport_login() will be calling mutex_lock() while running inside an RCU-protected section, triggering the warning 'sleeping function called from invalid context'. To fix this we can drop the rcu functions here

[PATCH AUTOSEL 4.14 27/57] mmc: tegra: prevent HS200 on Tegra 3

2018-09-14 Thread Sasha Levin
From: Stefan Agner [ Upstream commit 127407e36f4fe3a1d5e8b9998b479956ce83a7dc ] The stack assumes that SDHC controller which support SD3.0 (SDR104) do support HS200. This is not the case for Tegra 3, which does support SD 3.0 but only supports eMMC spec 4.41. Use SDHCI_QUIRK2_BROKEN_HS200 to in

[PATCH AUTOSEL 4.14 20/57] ARM: hisi: fix error handling and missing of_node_put

2018-09-14 Thread Sasha Levin
From: Nicholas Mc Guire [ Upstream commit 9f30b5ae0585ca5234fe979294b8f897299dec99 ] of_iomap() can return NULL which seems critical here and thus should be explicitly flagged so that the cause of system halting can be understood. As of_find_compatible_node() is returning a device node with refc

[PATCH AUTOSEL 4.14 28/57] mmc: sdhci: do not try to use 3.3V signaling if not supported

2018-09-14 Thread Sasha Levin
From: Stefan Agner [ Upstream commit 1b5190c2e74c47ebe4bcecf7a072358ad9f1feaa ] For eMMC devices it is valid to only support 1.8V signaling. When vqmmc is set to a fixed 1.8V regulator the stack tries to set 3.3V initially and prints the following warning: mmc1: Switching to 3.3V signalling v

[PATCH AUTOSEL 4.14 47/57] selftest: timers: Tweak raw_skew to SKIP when ADJ_OFFSET/other clock adjustments are in progress

2018-09-14 Thread Sasha Levin
From: John Stultz [ Upstream commit 1416270f4a1ae83ea84156ceba19a66a8f88be1f ] In the past we've warned when ADJ_OFFSET was in progress, usually caused by ntpd or some other time adjusting daemon running in non steady sate, which can cause the skew calculations to be incorrect. Thus, this patch

[PATCH AUTOSEL 4.14 29/57] drm/nouveau: Fix runtime PM leak in drm_open()

2018-09-14 Thread Sasha Levin
From: Lyude Paul [ Upstream commit 922a8c82fafdec99688bbaea6c5889f562a42cdc ] Noticed this as I was skimming through, if we fail to allocate memory for cli we'll end up returning without dropping the runtime PM ref we got. Additionally, we'll even return the wrong return code! (ret most likely w

[PATCH AUTOSEL 4.14 25/57] tty: fix termios input-speed encoding

2018-09-14 Thread Sasha Levin
From: Johan Hovold [ Upstream commit fada18c48d774b9e837928ecdce6a5d5fdd11ee7 ] Make sure to clear the CIBAUD bits before OR-ing the new mask when encoding the termios input baud rate. This could otherwise lead to an incorrect input rate being reported back and incidentally set on subsequent te

[PATCH AUTOSEL 4.14 49/57] dmaengine: hsu: Support dmaengine_terminate_sync()

2018-09-14 Thread Sasha Levin
From: Andy Shevchenko [ Upstream commit 2abc66cd499aa16876e45c6438788902f7d1ce22 ] It appears that the driver misses the support of dmaengine_terminate_sync(). Since many of callers expects this behaviour implement the new device_synchronize() callback to allow proper synchronization when stoppi

[PATCH AUTOSEL 4.14 16/57] pinctrl: pinmux: Return selector to the pinctrl driver

2018-09-14 Thread Sasha Levin
From: Tony Lindgren [ Upstream commit f913cfce4ee49a3382a9ff95696f49a46e56e974 ] We must return the selector from pinmux_generic_add_function() so pin controller device drivers can remove the right group if needed for deferred probe for example. And we now must make sure that a proper name is pa

[PATCH AUTOSEL 4.14 30/57] drm/nouveau/debugfs: Wake up GPU before doing any reclocking

2018-09-14 Thread Sasha Levin
From: Karol Herbst [ Upstream commit eaeb9010bb4bcdc20e58254fa42f3fe730a7f908 ] Fixes various reclocking related issues on prime systems. Signed-off-by: Karol Herbst Signed-off-by: Martin Peres Signed-off-by: Ben Skeggs Signed-off-by: Sasha Levin --- drivers/gpu/drm/nouveau/nouveau_debugfs

[PATCH AUTOSEL 4.14 35/57] coresight: tpiu: Fix disabling timeouts

2018-09-14 Thread Sasha Levin
From: Robin Murphy [ Upstream commit ccff2dfaceaca4517432f5c149594215fe9098cc ] Probing the TPIU driver under UBSan triggers an out-of-bounds shift warning in coresight_timeout(): ... [5.677530] UBSAN: Undefined behaviour in drivers/hwtracing/coresight/coresight.c:929:16 [5.685542] shi

[PATCH AUTOSEL 4.14 34/57] coresight: Handle errors in finding input/output ports

2018-09-14 Thread Sasha Levin
From: Suzuki K Poulose [ Upstream commit fe470f5f7f684ed15bc49b6183a64237547910ff ] If we fail to find the input / output port for a LINK component while enabling a path, we should fail gracefully rather than assuming port "0". Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by

[PATCH AUTOSEL 4.14 32/57] parport: sunbpp: fix error return code

2018-09-14 Thread Sasha Levin
From: Julia Lawall [ Upstream commit faa1a47388b33623e4d504c23569188907b039a0 ] Return an error code on failure. Change leading spaces to tab on the first if. Problem found using Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman Signed

[PATCH AUTOSEL 4.14 02/57] net/mlx5: Add missing SET_DRIVER_VERSION command translation

2018-09-14 Thread Sasha Levin
From: Noa Osherovich [ Upstream commit 0f4039104ee61e14ac4771a2181c2a20572f4ec9 ] When translating command opcodes to a string, SET_DRIVER_VERSION command was missing. Fixes: 42ca502e179d0 ('net/mlx5_core: Use a macro in mlx5_command_str()') Signed-off-by: Noa Osherovich Signed-off-by: Saeed M

[PATCH AUTOSEL 4.14 07/57] Bluetooth: Use lock_sock_nested in bt_accept_enqueue

2018-09-14 Thread Sasha Levin
From: Philipp Puschmann [ Upstream commit b71c69c26b4916d11b8d403d8e667bbd191f1b8f ] Fixes this warning that was provoked by a pairing: [60258.016221] WARNING: possible recursive locking detected [60258.021558] 4.15.0-RD1812-BSP #1 Tainted: G O [60258.027146] -

[PATCH AUTOSEL 4.14 13/57] MIPS: loongson64: cs5536: Fix PCI_OHCI_INT_REG reads

2018-09-14 Thread Sasha Levin
From: Paul Burton [ Upstream commit cd87668d601f622e0ebcfea4f78d116d5f572f4d ] The PCI_OHCI_INT_REG case in pci_ohci_read_reg() contains the following if statement: if ((lo & 0x0f00) == CS5536_USB_INTR) CS5536_USB_INTR expands to the constant 11, which gives us the following condition wh

<    1   2   3   4   5   6   7   >