rockchip64: merge rockpi-s into rockchip64 family
This commit is contained in:
parent
16e2c6a8fc
commit
a2fd19da52
@ -1,15 +1,76 @@
|
||||
# Rockchip RK3308 quad core 256-512MB SoC WiFi
|
||||
BOARD_NAME="Rockpi S"
|
||||
BOARDFAMILY="rockpis"
|
||||
BOARDFAMILY="rockchip64"
|
||||
BOARD_MAINTAINER="brentr"
|
||||
BOOTCONFIG="rock-pi-s-rk3308_defconfig"
|
||||
|
||||
DEFAULT_CONSOLE="serial"
|
||||
MODULES_LEGACY="g_serial"
|
||||
SERIALCON="ttyS0"
|
||||
KERNEL_TARGET="legacy,current,edge"
|
||||
KERNEL_TARGET="current,edge"
|
||||
KERNEL_TEST_TARGET="current,edge"
|
||||
BOOT_FDT_FILE="rockchip/rk3308-rock-pi-s.dtb"
|
||||
MODULES_BLACKLIST="rockchipdrm analogix_dp dw_mipi_dsi dw_hdmi gpu_sched lima hantro_vpu panfrost"
|
||||
HAS_VIDEO_OUTPUT="no"
|
||||
BOOTBRANCH_BOARD="tag:v2022.04"
|
||||
BOOTPATCHDIR="u-boot-rockchip64-v2022.04"
|
||||
|
||||
BOOTENV_FILE='rockpis.txt'
|
||||
OVERLAY_PREFIX='rk3308'
|
||||
|
||||
#comment out line below for an image that will NOT boot from the built-in SDNAND
|
||||
IDBLOADER_BLOB=$SRC/packages/blobs/rockchip/rk3308_idbloader_ddr589MHz_uart0_m0_v2.06.136sd.bin
|
||||
|
||||
#The SDNAND capabilty IDBLOADER_BLOB requires the U-Boot and Linux serial console on UART0
|
||||
#Linux will hang on reboot if the console remains on UART2
|
||||
|
||||
#Note: IDBLOADER_BLOB is derived from
|
||||
# https://dl.radxa.com/rockpis/images/loader/rk3308_loader_ddr589MHz_uart0_m0_v2.06.136sd.bin
|
||||
#by using the rkdeveloptool to "upgrade" the previous DDR_BLOB loader on the SDNAND
|
||||
#To recreate it, build the image with IDBLOADER_BLOB unset and boot Rock PI-S in MASKROM mode
|
||||
#On your host (connected to the RockPi-S's USB-C port):
|
||||
# rdeveloptool db rk3308_loader_ddr589MHz_uart0_m0_v2.06.136sd.bin
|
||||
# rdeveloptool wl 0 newly_built_image.img
|
||||
# rdeveloptool ul rk3308_loader_ddr589MHz_uart0_m0_v2.06.136sd.bin #this writes 280 sectors
|
||||
|
||||
#Then, reset the RockPi-S to boot from SDNAND. Using that running image:
|
||||
# dd if=/dev/mmcblk0 of=rk3308_idbloader_ddr589MHz_uart0_m0_v2.06.136sd.bin skip=64 count=280
|
||||
|
||||
|
||||
function post_family_config___uboot_config() {
|
||||
|
||||
display_alert "$BOARD" "u-boot ${BOOTBRANCH_BOARD} overrides" "info"
|
||||
unset uboot_custom_postprocess family_tweaks_bsp # disable stuff from rockchip64_common
|
||||
|
||||
BOOTSCRIPT=boot-rockpis.cmd:boot.cmd
|
||||
|
||||
uboot_custom_postprocess() {
|
||||
|
||||
# TODO: remove this diversion from common caused by different loaderimage params
|
||||
run_host_x86_binary_logged $RKBIN_DIR/tools/loaderimage --pack --uboot ./u-boot-dtb.bin uboot.img 0x600000 --size 1024 1 &&
|
||||
if [ -r "$IDBLOADER_BLOB" ]; then
|
||||
echo "Installing $IDBLOADER_BLOB"
|
||||
echo "Capable of booting from built-in SDNAND"
|
||||
cp $IDBLOADER_BLOB idbloader.bin
|
||||
else
|
||||
[ "$IDBLOADER_BLOB" ] && echo "Missing $IDBLOADER_BLOB"
|
||||
echo "WARNING: This image will not boot from built-in SDNAND"
|
||||
tools/mkimage -n rk3308 -T rksd -d $RKBIN_DIR/$DDR_BLOB idbloader.bin &&
|
||||
cat $RKBIN_DIR/$MINILOADER_BLOB >> idbloader.bin
|
||||
fi &&
|
||||
run_host_x86_binary_logged $RKBIN_DIR/tools/trust_merger --replace bl31.elf $RKBIN_DIR/$BL31_BLOB trust.ini
|
||||
}
|
||||
|
||||
family_tweaks_bsp() { #Install udev script that derives fixed, unique MAC addresses for net interfaces
|
||||
|
||||
#that are assigned random ones -- like RockPI-S's WiFi network interfaces
|
||||
bsp=$SRC/packages/bsp/rockpis
|
||||
rules=etc/udev/rules.d
|
||||
|
||||
install -m 755 $bsp/lib/udev/fixEtherAddr $destination/lib/udev &&
|
||||
install -m 644 $bsp/$rules/05-fixMACaddress.rules $destination/$rules
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,68 +0,0 @@
|
||||
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
|
||||
index 4cdadc24..45263aa6 100644
|
||||
--- a/arch/arm64/Makefile
|
||||
+++ b/arch/arm64/Makefile
|
||||
@@ -100,7 +100,7 @@ core-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
|
||||
ifeq ($(CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE),y)
|
||||
KBUILD_IMAGE := $(subst $\",,$(CONFIG_BUILD_ARM64_APPENDED_KERNEL_IMAGE_NAME))
|
||||
else
|
||||
-KBUILD_IMAGE := Image.gz
|
||||
+KBUILD_IMAGE := Image
|
||||
endif
|
||||
|
||||
KBUILD_DTBS := dtbs
|
||||
@@ -121,6 +121,12 @@ zinstall install: vmlinux
|
||||
%.dtb: scripts
|
||||
$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
|
||||
|
||||
+%.dtbo: | scripts
|
||||
+ $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
|
||||
+
|
||||
+%.scr: | scripts
|
||||
+ $(Q)$(MAKE) $(build)=$(boot)/dts ARCH=$(ARCH) $(boot)/dts/$@
|
||||
+
|
||||
PHONY += dtbs dtbs_install
|
||||
|
||||
dtbs: prepare scripts
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3308.dtsi b/arch/arm64/boot/dts/rockchip/rk3308.dtsi
|
||||
index dfa1ae79..2a0d76b4 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3308.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3308.dtsi
|
||||
@@ -180,7 +180,6 @@
|
||||
opp-microvolt-L4 = <1150000 1150000 1340000>;
|
||||
opp-microvolt-L5 = <1125000 1125000 1340000>;
|
||||
clock-latency-ns = <40000>;
|
||||
- status = "disabled";
|
||||
};
|
||||
opp-1296000000 {
|
||||
opp-hz = /bits/ 64 <1296000000>;
|
||||
@@ -192,7 +191,6 @@
|
||||
opp-microvolt-L4 = <1200000 1200000 1340000>;
|
||||
opp-microvolt-L5 = <1175000 1175000 1340000>;
|
||||
clock-latency-ns = <40000>;
|
||||
- status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts b/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts
|
||||
index c64afc6a..e039eaa9 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <dt-bindings/input/input.h>
|
||||
/* #include "rk3308.dtsi" */
|
||||
-#include "rk3308k.dtsi"
|
||||
+#include "rk3308.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Radxa ROCK Pi S";
|
||||
@@ -151,7 +151,7 @@
|
||||
pinctrl-1 = <&uart4_rts_gpio>;
|
||||
BT,power_gpio = <&gpio4 RK_PB3 GPIO_ACTIVE_HIGH>;
|
||||
BT,wake_host_irq = <&gpio4 RK_PB4 GPIO_ACTIVE_HIGH>;
|
||||
- status = "okay";
|
||||
+ status = "disabled";
|
||||
};
|
||||
|
||||
wireless-wlan {
|
||||
@ -1,13 +0,0 @@
|
||||
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
|
||||
index 3216e09..21bce28
|
||||
--- a/arch/arm64/mm/dma-mapping.c
|
||||
+++ b/arch/arm64/mm/dma-mapping.c
|
||||
@@ -44,7 +44,7 @@ static pgprot_t __get_dma_pgprot(unsigned long attrs, pgprot_t prot,
|
||||
|
||||
static struct gen_pool *atomic_pool;
|
||||
|
||||
-#define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_256K
|
||||
+#define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_2M
|
||||
static size_t atomic_pool_size __initdata = DEFAULT_DMA_COHERENT_POOL_SIZE;
|
||||
|
||||
static int __init early_coherent_pool(char *p)
|
||||
@ -1,15 +0,0 @@
|
||||
DMC is non functional for ROCK Pi S anyway.
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts b/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts
|
||||
index 4a72ffed8..0eb7cc628 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts
|
||||
@@ -202,7 +202,7 @@
|
||||
|
||||
&dmc {
|
||||
center-supply = <&vdd_log>;
|
||||
- status = "okay";
|
||||
+ status = "disabled";
|
||||
};
|
||||
|
||||
&emmc {
|
||||
@ -1,17 +0,0 @@
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts b/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts
|
||||
index 0eb7cc628..d3a8a3c79 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts
|
||||
@@ -342,6 +342,12 @@
|
||||
};
|
||||
};
|
||||
|
||||
+&uart0 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart0_xfer>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&uart4 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart4_xfer &uart4_cts>;
|
||||
@ -1,17 +0,0 @@
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts b/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts
|
||||
index aa5ce6856..4a72ffed8 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts
|
||||
@@ -365,12 +365,6 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
-&thermal_zones {
|
||||
- soc_thermal {
|
||||
- thermal-sensors = <&tsadc 0>;
|
||||
- };
|
||||
-};
|
||||
-
|
||||
&wdt {
|
||||
status = "okay";
|
||||
};
|
||||
@ -1,35 +0,0 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index adf05079..82d77dda 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -382,9 +382,17 @@ CHECK = sparse
|
||||
|
||||
# Use the wrapper for the compiler. This wrapper scans for new
|
||||
# warnings and causes the build to stop upon encountering them.
|
||||
+ifeq ("$(origin GCC_WRAPPER)", "command line")
|
||||
+ KGCC_WRAPPER = $(GCC_WRAPPER)
|
||||
+endif
|
||||
+ifndef KGCC_WRAPPER
|
||||
+ KGCC_WRAPPER = 0
|
||||
+endif
|
||||
+ifeq ($(KGCC_WRAPPER),1)
|
||||
ifneq ($(wildcard $(srctree)/scripts/gcc-wrapper.py),)
|
||||
CC = $(srctree)/scripts/gcc-wrapper.py $(CROSS_COMPILE)gcc
|
||||
endif
|
||||
+endif
|
||||
|
||||
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
|
||||
-Wbitwise -Wno-return-void $(CF)
|
||||
@@ -442,10 +450,8 @@ export MAKE AWK GENKSYMS INSTALLKERNEL PERL PYTHON UTS_MACHINE
|
||||
export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
|
||||
|
||||
export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
|
||||
-export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV
|
||||
-export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE
|
||||
-export CFLAGS_KCOV
|
||||
-export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
|
||||
+export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV CFLAGS_KCOV CFLAGS_KASAN
|
||||
+export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE CFLAGS_KASAN_NOSANITIZE
|
||||
export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
|
||||
export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
|
||||
export KBUILD_ARFLAGS
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,679 +0,0 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 99b211904ac5..847f2537d39d 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,6 +1,6 @@
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 4
|
||||
-SUBLEVEL = 229
|
||||
+SUBLEVEL = 230
|
||||
EXTRAVERSION =
|
||||
NAME = Blurry Fish Butt
|
||||
|
||||
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
|
||||
index 6abd6b41c13d..36472fc266fd 100644
|
||||
--- a/arch/mips/kernel/traps.c
|
||||
+++ b/arch/mips/kernel/traps.c
|
||||
@@ -2080,6 +2080,7 @@ static void configure_status(void)
|
||||
|
||||
change_c0_status(ST0_CU|ST0_MX|ST0_RE|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX,
|
||||
status_set);
|
||||
+ back_to_back_c0_hazard();
|
||||
}
|
||||
|
||||
/* configure HWRENA register */
|
||||
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
|
||||
index cf3975ee4fd8..c48ddeb6c328 100644
|
||||
--- a/crypto/af_alg.c
|
||||
+++ b/crypto/af_alg.c
|
||||
@@ -130,21 +130,15 @@ EXPORT_SYMBOL_GPL(af_alg_release);
|
||||
void af_alg_release_parent(struct sock *sk)
|
||||
{
|
||||
struct alg_sock *ask = alg_sk(sk);
|
||||
- unsigned int nokey = ask->nokey_refcnt;
|
||||
- bool last = nokey && !ask->refcnt;
|
||||
+ unsigned int nokey = atomic_read(&ask->nokey_refcnt);
|
||||
|
||||
sk = ask->parent;
|
||||
ask = alg_sk(sk);
|
||||
|
||||
- local_bh_disable();
|
||||
- bh_lock_sock(sk);
|
||||
- ask->nokey_refcnt -= nokey;
|
||||
- if (!last)
|
||||
- last = !--ask->refcnt;
|
||||
- bh_unlock_sock(sk);
|
||||
- local_bh_enable();
|
||||
+ if (nokey)
|
||||
+ atomic_dec(&ask->nokey_refcnt);
|
||||
|
||||
- if (last)
|
||||
+ if (atomic_dec_and_test(&ask->refcnt))
|
||||
sock_put(sk);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(af_alg_release_parent);
|
||||
@@ -189,7 +183,7 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
|
||||
|
||||
err = -EBUSY;
|
||||
lock_sock(sk);
|
||||
- if (ask->refcnt | ask->nokey_refcnt)
|
||||
+ if (atomic_read(&ask->refcnt))
|
||||
goto unlock;
|
||||
|
||||
swap(ask->type, type);
|
||||
@@ -238,7 +232,7 @@ static int alg_setsockopt(struct socket *sock, int level, int optname,
|
||||
int err = -EBUSY;
|
||||
|
||||
lock_sock(sk);
|
||||
- if (ask->refcnt)
|
||||
+ if (atomic_read(&ask->refcnt) != atomic_read(&ask->nokey_refcnt))
|
||||
goto unlock;
|
||||
|
||||
type = ask->type;
|
||||
@@ -305,12 +299,14 @@ int af_alg_accept(struct sock *sk, struct socket *newsock)
|
||||
|
||||
sk2->sk_family = PF_ALG;
|
||||
|
||||
- if (nokey || !ask->refcnt++)
|
||||
+ if (atomic_inc_return_relaxed(&ask->refcnt) == 1)
|
||||
sock_hold(sk);
|
||||
- ask->nokey_refcnt += nokey;
|
||||
+ if (nokey) {
|
||||
+ atomic_inc(&ask->nokey_refcnt);
|
||||
+ atomic_set(&alg_sk(sk2)->nokey_refcnt, 1);
|
||||
+ }
|
||||
alg_sk(sk2)->parent = sk;
|
||||
alg_sk(sk2)->type = type;
|
||||
- alg_sk(sk2)->nokey_refcnt = nokey;
|
||||
|
||||
newsock->ops = type->ops;
|
||||
newsock->state = SS_CONNECTED;
|
||||
diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c
|
||||
index faea9d728fd2..c50175ad5485 100644
|
||||
--- a/crypto/algif_aead.c
|
||||
+++ b/crypto/algif_aead.c
|
||||
@@ -528,7 +528,7 @@ static int aead_check_key(struct socket *sock)
|
||||
struct alg_sock *ask = alg_sk(sk);
|
||||
|
||||
lock_sock(sk);
|
||||
- if (ask->refcnt)
|
||||
+ if (!atomic_read(&ask->nokey_refcnt))
|
||||
goto unlock_child;
|
||||
|
||||
psk = ask->parent;
|
||||
@@ -540,11 +540,8 @@ static int aead_check_key(struct socket *sock)
|
||||
if (!tfm->has_key)
|
||||
goto unlock;
|
||||
|
||||
- if (!pask->refcnt++)
|
||||
- sock_hold(psk);
|
||||
-
|
||||
- ask->refcnt = 1;
|
||||
- sock_put(psk);
|
||||
+ atomic_dec(&pask->nokey_refcnt);
|
||||
+ atomic_set(&ask->nokey_refcnt, 0);
|
||||
|
||||
err = 0;
|
||||
|
||||
diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c
|
||||
index 8d8b3eeba725..fd23261f1d16 100644
|
||||
--- a/crypto/algif_hash.c
|
||||
+++ b/crypto/algif_hash.c
|
||||
@@ -252,7 +252,7 @@ static int hash_check_key(struct socket *sock)
|
||||
struct alg_sock *ask = alg_sk(sk);
|
||||
|
||||
lock_sock(sk);
|
||||
- if (ask->refcnt)
|
||||
+ if (!atomic_read(&ask->nokey_refcnt))
|
||||
goto unlock_child;
|
||||
|
||||
psk = ask->parent;
|
||||
@@ -264,11 +264,8 @@ static int hash_check_key(struct socket *sock)
|
||||
if (!tfm->has_key)
|
||||
goto unlock;
|
||||
|
||||
- if (!pask->refcnt++)
|
||||
- sock_hold(psk);
|
||||
-
|
||||
- ask->refcnt = 1;
|
||||
- sock_put(psk);
|
||||
+ atomic_dec(&pask->nokey_refcnt);
|
||||
+ atomic_set(&ask->nokey_refcnt, 0);
|
||||
|
||||
err = 0;
|
||||
|
||||
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
|
||||
index 9bd4691cc5c5..0e200bf5aa82 100644
|
||||
--- a/crypto/algif_skcipher.c
|
||||
+++ b/crypto/algif_skcipher.c
|
||||
@@ -774,7 +774,7 @@ static int skcipher_check_key(struct socket *sock)
|
||||
struct alg_sock *ask = alg_sk(sk);
|
||||
|
||||
lock_sock(sk);
|
||||
- if (ask->refcnt)
|
||||
+ if (!atomic_read(&ask->nokey_refcnt))
|
||||
goto unlock_child;
|
||||
|
||||
psk = ask->parent;
|
||||
@@ -786,11 +786,8 @@ static int skcipher_check_key(struct socket *sock)
|
||||
if (!tfm->has_key)
|
||||
goto unlock;
|
||||
|
||||
- if (!pask->refcnt++)
|
||||
- sock_hold(psk);
|
||||
-
|
||||
- ask->refcnt = 1;
|
||||
- sock_put(psk);
|
||||
+ atomic_dec(&pask->nokey_refcnt);
|
||||
+ atomic_set(&ask->nokey_refcnt, 0);
|
||||
|
||||
err = 0;
|
||||
|
||||
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
|
||||
index 1e5cd39d0cc2..bdc3efacd0d2 100644
|
||||
--- a/drivers/block/virtio_blk.c
|
||||
+++ b/drivers/block/virtio_blk.c
|
||||
@@ -757,6 +757,7 @@ out_put_disk:
|
||||
put_disk(vblk->disk);
|
||||
out_free_vq:
|
||||
vdev->config->del_vqs(vdev);
|
||||
+ kfree(vblk->vqs);
|
||||
out_free_vblk:
|
||||
kfree(vblk);
|
||||
out_free_index:
|
||||
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
|
||||
index 932ba7676183..5f86075e34da 100644
|
||||
--- a/drivers/edac/amd64_edac.c
|
||||
+++ b/drivers/edac/amd64_edac.c
|
||||
@@ -248,6 +248,8 @@ static int get_scrub_rate(struct mem_ctl_info *mci)
|
||||
|
||||
if (pvt->model == 0x60)
|
||||
amd64_read_pci_cfg(pvt->F2, F15H_M60H_SCRCTRL, &scrubval);
|
||||
+ else
|
||||
+ amd64_read_pci_cfg(pvt->F3, SCRCTRL, &scrubval);
|
||||
} else
|
||||
amd64_read_pci_cfg(pvt->F3, SCRCTRL, &scrubval);
|
||||
|
||||
diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
|
||||
index e27f7e12c05b..9b4ad6c74041 100644
|
||||
--- a/drivers/hwmon/acpi_power_meter.c
|
||||
+++ b/drivers/hwmon/acpi_power_meter.c
|
||||
@@ -895,7 +895,7 @@ static int acpi_power_meter_add(struct acpi_device *device)
|
||||
|
||||
res = setup_attrs(resource);
|
||||
if (res)
|
||||
- goto exit_free;
|
||||
+ goto exit_free_capability;
|
||||
|
||||
resource->hwmon_dev = hwmon_device_register(&device->dev);
|
||||
if (IS_ERR(resource->hwmon_dev)) {
|
||||
@@ -908,6 +908,8 @@ static int acpi_power_meter_add(struct acpi_device *device)
|
||||
|
||||
exit_remove:
|
||||
remove_attrs(resource);
|
||||
+exit_free_capability:
|
||||
+ free_capabilities(resource);
|
||||
exit_free:
|
||||
kfree(resource);
|
||||
exit:
|
||||
diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6697.c
|
||||
index f03a71722849..d4bb3d6aaf18 100644
|
||||
--- a/drivers/hwmon/max6697.c
|
||||
+++ b/drivers/hwmon/max6697.c
|
||||
@@ -46,8 +46,9 @@ static const u8 MAX6697_REG_CRIT[] = {
|
||||
* Map device tree / platform data register bit map to chip bit map.
|
||||
* Applies to alert register and over-temperature register.
|
||||
*/
|
||||
-#define MAX6697_MAP_BITS(reg) ((((reg) & 0x7e) >> 1) | \
|
||||
+#define MAX6697_ALERT_MAP_BITS(reg) ((((reg) & 0x7e) >> 1) | \
|
||||
(((reg) & 0x01) << 6) | ((reg) & 0x80))
|
||||
+#define MAX6697_OVERT_MAP_BITS(reg) (((reg) >> 1) | (((reg) & 0x01) << 7))
|
||||
|
||||
#define MAX6697_REG_STAT(n) (0x44 + (n))
|
||||
|
||||
@@ -586,12 +587,12 @@ static int max6697_init_chip(struct max6697_data *data,
|
||||
return ret;
|
||||
|
||||
ret = i2c_smbus_write_byte_data(client, MAX6697_REG_ALERT_MASK,
|
||||
- MAX6697_MAP_BITS(pdata->alert_mask));
|
||||
+ MAX6697_ALERT_MAP_BITS(pdata->alert_mask));
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = i2c_smbus_write_byte_data(client, MAX6697_REG_OVERT_MASK,
|
||||
- MAX6697_MAP_BITS(pdata->over_temperature_mask));
|
||||
+ MAX6697_OVERT_MAP_BITS(pdata->over_temperature_mask));
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c
|
||||
index e370804ec8bc..3a9db4626cb6 100644
|
||||
--- a/drivers/i2c/algos/i2c-algo-pca.c
|
||||
+++ b/drivers/i2c/algos/i2c-algo-pca.c
|
||||
@@ -326,7 +326,8 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,
|
||||
DEB2("BUS ERROR - SDA Stuck low\n");
|
||||
pca_reset(adap);
|
||||
goto out;
|
||||
- case 0x90: /* Bus error - SCL stuck low */
|
||||
+ case 0x78: /* Bus error - SCL stuck low (PCA9665) */
|
||||
+ case 0x90: /* Bus error - SCL stuck low (PCA9564) */
|
||||
DEB2("BUS ERROR - SCL Stuck low\n");
|
||||
pca_reset(adap);
|
||||
goto out;
|
||||
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
|
||||
index bc92a498ec03..9f19aa950bb1 100644
|
||||
--- a/drivers/usb/misc/usbtest.c
|
||||
+++ b/drivers/usb/misc/usbtest.c
|
||||
@@ -2703,6 +2703,7 @@ static void usbtest_disconnect(struct usb_interface *intf)
|
||||
|
||||
usb_set_intfdata(intf, NULL);
|
||||
dev_dbg(&intf->dev, "disconnect\n");
|
||||
+ kfree(dev->buf);
|
||||
kfree(dev);
|
||||
}
|
||||
|
||||
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
|
||||
index 972475eeb2dd..b1125778b908 100644
|
||||
--- a/fs/btrfs/inode.c
|
||||
+++ b/fs/btrfs/inode.c
|
||||
@@ -926,7 +926,7 @@ static noinline int cow_file_range(struct inode *inode,
|
||||
u64 alloc_hint = 0;
|
||||
u64 num_bytes;
|
||||
unsigned long ram_size;
|
||||
- u64 disk_num_bytes;
|
||||
+ u64 min_alloc_size;
|
||||
u64 cur_alloc_size;
|
||||
u64 blocksize = root->sectorsize;
|
||||
struct btrfs_key ins;
|
||||
@@ -942,7 +942,6 @@ static noinline int cow_file_range(struct inode *inode,
|
||||
|
||||
num_bytes = ALIGN(end - start + 1, blocksize);
|
||||
num_bytes = max(blocksize, num_bytes);
|
||||
- disk_num_bytes = num_bytes;
|
||||
|
||||
/* if this is a small write inside eof, kick off defrag */
|
||||
if (num_bytes < 64 * 1024 &&
|
||||
@@ -969,18 +968,33 @@ static noinline int cow_file_range(struct inode *inode,
|
||||
}
|
||||
}
|
||||
|
||||
- BUG_ON(disk_num_bytes >
|
||||
- btrfs_super_total_bytes(root->fs_info->super_copy));
|
||||
+ BUG_ON(num_bytes > btrfs_super_total_bytes(root->fs_info->super_copy));
|
||||
|
||||
alloc_hint = get_extent_allocation_hint(inode, start, num_bytes);
|
||||
btrfs_drop_extent_cache(inode, start, start + num_bytes - 1, 0);
|
||||
|
||||
- while (disk_num_bytes > 0) {
|
||||
+ /*
|
||||
+ * Relocation relies on the relocated extents to have exactly the same
|
||||
+ * size as the original extents. Normally writeback for relocation data
|
||||
+ * extents follows a NOCOW path because relocation preallocates the
|
||||
+ * extents. However, due to an operation such as scrub turning a block
|
||||
+ * group to RO mode, it may fallback to COW mode, so we must make sure
|
||||
+ * an extent allocated during COW has exactly the requested size and can
|
||||
+ * not be split into smaller extents, otherwise relocation breaks and
|
||||
+ * fails during the stage where it updates the bytenr of file extent
|
||||
+ * items.
|
||||
+ */
|
||||
+ if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID)
|
||||
+ min_alloc_size = num_bytes;
|
||||
+ else
|
||||
+ min_alloc_size = root->sectorsize;
|
||||
+
|
||||
+ while (num_bytes > 0) {
|
||||
unsigned long op;
|
||||
|
||||
- cur_alloc_size = disk_num_bytes;
|
||||
+ cur_alloc_size = num_bytes;
|
||||
ret = btrfs_reserve_extent(root, cur_alloc_size,
|
||||
- root->sectorsize, 0, alloc_hint,
|
||||
+ min_alloc_size, 0, alloc_hint,
|
||||
&ins, 1, 1);
|
||||
if (ret < 0)
|
||||
goto out_unlock;
|
||||
@@ -1033,7 +1047,7 @@ static noinline int cow_file_range(struct inode *inode,
|
||||
goto out_drop_extent_cache;
|
||||
}
|
||||
|
||||
- if (disk_num_bytes < cur_alloc_size)
|
||||
+ if (num_bytes < cur_alloc_size)
|
||||
break;
|
||||
|
||||
/* we're not doing compressed IO, don't unlock the first
|
||||
@@ -1050,8 +1064,10 @@ static noinline int cow_file_range(struct inode *inode,
|
||||
start + ram_size - 1, locked_page,
|
||||
EXTENT_LOCKED | EXTENT_DELALLOC,
|
||||
op);
|
||||
- disk_num_bytes -= cur_alloc_size;
|
||||
- num_bytes -= cur_alloc_size;
|
||||
+ if (num_bytes < cur_alloc_size)
|
||||
+ num_bytes = 0;
|
||||
+ else
|
||||
+ num_bytes -= cur_alloc_size;
|
||||
alloc_hint = ins.objectid + ins.offset;
|
||||
start += cur_alloc_size;
|
||||
}
|
||||
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
|
||||
index 21ddfd77966e..f4ef8d6ea8ed 100644
|
||||
--- a/fs/cifs/connect.c
|
||||
+++ b/fs/cifs/connect.c
|
||||
@@ -4203,9 +4203,12 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid)
|
||||
vol_info->retry = master_tcon->retry;
|
||||
vol_info->nocase = master_tcon->nocase;
|
||||
vol_info->local_lease = master_tcon->local_lease;
|
||||
+ vol_info->resilient = master_tcon->use_resilient;
|
||||
+ vol_info->persistent = master_tcon->use_persistent;
|
||||
vol_info->no_linux_ext = !master_tcon->unix_ext;
|
||||
vol_info->sectype = master_tcon->ses->sectype;
|
||||
vol_info->sign = master_tcon->ses->sign;
|
||||
+ vol_info->seal = master_tcon->seal;
|
||||
|
||||
rc = cifs_set_vol_auth(vol_info, master_tcon->ses);
|
||||
if (rc) {
|
||||
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
|
||||
index c18c26a78453..a002e289a544 100644
|
||||
--- a/fs/cifs/inode.c
|
||||
+++ b/fs/cifs/inode.c
|
||||
@@ -1737,6 +1737,7 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry,
|
||||
FILE_UNIX_BASIC_INFO *info_buf_target;
|
||||
unsigned int xid;
|
||||
int rc, tmprc;
|
||||
+ bool new_target = d_really_is_negative(target_dentry);
|
||||
|
||||
if (flags & ~RENAME_NOREPLACE)
|
||||
return -EINVAL;
|
||||
@@ -1813,8 +1814,13 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry,
|
||||
*/
|
||||
|
||||
unlink_target:
|
||||
- /* Try unlinking the target dentry if it's not negative */
|
||||
- if (d_really_is_positive(target_dentry) && (rc == -EACCES || rc == -EEXIST)) {
|
||||
+ /*
|
||||
+ * If the target dentry was created during the rename, try
|
||||
+ * unlinking it if it's not negative
|
||||
+ */
|
||||
+ if (new_target &&
|
||||
+ d_really_is_positive(target_dentry) &&
|
||||
+ (rc == -EACCES || rc == -EEXIST)) {
|
||||
if (d_is_dir(target_dentry))
|
||||
tmprc = cifs_rmdir(target_dir, target_dentry);
|
||||
else
|
||||
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
|
||||
index a2bfd7843f18..4bb6b98782e9 100644
|
||||
--- a/include/crypto/if_alg.h
|
||||
+++ b/include/crypto/if_alg.h
|
||||
@@ -30,8 +30,8 @@ struct alg_sock {
|
||||
|
||||
struct sock *parent;
|
||||
|
||||
- unsigned int refcnt;
|
||||
- unsigned int nokey_refcnt;
|
||||
+ atomic_t refcnt;
|
||||
+ atomic_t nokey_refcnt;
|
||||
|
||||
const struct af_alg_type *type;
|
||||
void *private;
|
||||
diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h
|
||||
index c9e4731cf10b..7fc36ebc5de3 100644
|
||||
--- a/include/linux/sched/sysctl.h
|
||||
+++ b/include/linux/sched/sysctl.h
|
||||
@@ -81,6 +81,7 @@ extern unsigned int sysctl_sched_cfs_bandwidth_slice;
|
||||
extern unsigned int sysctl_sched_autogroup_enabled;
|
||||
#endif
|
||||
|
||||
+extern int sysctl_sched_rr_timeslice;
|
||||
extern int sched_rr_timeslice;
|
||||
|
||||
extern int sched_rr_handler(struct ctl_table *table, int write,
|
||||
diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
|
||||
index 9c939c6bf21c..321ccdbb7364 100644
|
||||
--- a/kernel/debug/debug_core.c
|
||||
+++ b/kernel/debug/debug_core.c
|
||||
@@ -488,6 +488,7 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs,
|
||||
arch_kgdb_ops.disable_hw_break(regs);
|
||||
|
||||
acquirelock:
|
||||
+ rcu_read_lock();
|
||||
/*
|
||||
* Interrupts will be restored by the 'trap return' code, except when
|
||||
* single stepping.
|
||||
@@ -542,6 +543,7 @@ return_normal:
|
||||
atomic_dec(&slaves_in_kgdb);
|
||||
dbg_touch_watchdogs();
|
||||
local_irq_restore(flags);
|
||||
+ rcu_read_unlock();
|
||||
return 0;
|
||||
}
|
||||
cpu_relax();
|
||||
@@ -560,6 +562,7 @@ return_normal:
|
||||
raw_spin_unlock(&dbg_master_lock);
|
||||
dbg_touch_watchdogs();
|
||||
local_irq_restore(flags);
|
||||
+ rcu_read_unlock();
|
||||
|
||||
goto acquirelock;
|
||||
}
|
||||
@@ -677,6 +680,7 @@ kgdb_restore:
|
||||
raw_spin_unlock(&dbg_master_lock);
|
||||
dbg_touch_watchdogs();
|
||||
local_irq_restore(flags);
|
||||
+ rcu_read_unlock();
|
||||
|
||||
return kgdb_info[cpu].ret_state;
|
||||
}
|
||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
||||
index 14a87c1f3a3a..4a0a754f24c8 100644
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -8266,8 +8266,9 @@ int sched_rr_handler(struct ctl_table *table, int write,
|
||||
/* make sure that internally we keep jiffies */
|
||||
/* also, writing zero resets timeslice to default */
|
||||
if (!ret && write) {
|
||||
- sched_rr_timeslice = sched_rr_timeslice <= 0 ?
|
||||
- RR_TIMESLICE : msecs_to_jiffies(sched_rr_timeslice);
|
||||
+ sched_rr_timeslice =
|
||||
+ sysctl_sched_rr_timeslice <= 0 ? RR_TIMESLICE :
|
||||
+ msecs_to_jiffies(sysctl_sched_rr_timeslice);
|
||||
}
|
||||
mutex_unlock(&mutex);
|
||||
return ret;
|
||||
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
|
||||
index 801b4ec40702..5ee5740635f3 100644
|
||||
--- a/kernel/sched/rt.c
|
||||
+++ b/kernel/sched/rt.c
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <linux/irq_work.h>
|
||||
|
||||
int sched_rr_timeslice = RR_TIMESLICE;
|
||||
+int sysctl_sched_rr_timeslice = (MSEC_PER_SEC / HZ) * RR_TIMESLICE;
|
||||
|
||||
static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun);
|
||||
|
||||
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
|
||||
index c2dddd335d06..ecbb1b764a82 100644
|
||||
--- a/kernel/sysctl.c
|
||||
+++ b/kernel/sysctl.c
|
||||
@@ -412,7 +412,7 @@ static struct ctl_table kern_table[] = {
|
||||
},
|
||||
{
|
||||
.procname = "sched_rr_timeslice_ms",
|
||||
- .data = &sched_rr_timeslice,
|
||||
+ .data = &sysctl_sched_rr_timeslice,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = sched_rr_handler,
|
||||
diff --git a/mm/slub.c b/mm/slub.c
|
||||
index bb5237c67cbc..a3870034bfcc 100644
|
||||
--- a/mm/slub.c
|
||||
+++ b/mm/slub.c
|
||||
@@ -5305,7 +5305,8 @@ static void memcg_propagate_slab_attrs(struct kmem_cache *s)
|
||||
*/
|
||||
if (buffer)
|
||||
buf = buffer;
|
||||
- else if (root_cache->max_attr_size < ARRAY_SIZE(mbuf))
|
||||
+ else if (root_cache->max_attr_size < ARRAY_SIZE(mbuf) &&
|
||||
+ !IS_ENABLED(CONFIG_SLUB_STATS))
|
||||
buf = mbuf;
|
||||
else {
|
||||
buffer = (char *) get_zeroed_page(GFP_KERNEL);
|
||||
diff --git a/mm/swap_state.c b/mm/swap_state.c
|
||||
index d504adb7fa5f..9e587464e634 100644
|
||||
--- a/mm/swap_state.c
|
||||
+++ b/mm/swap_state.c
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <linux/migrate.h>
|
||||
|
||||
#include <asm/pgtable.h>
|
||||
+#include "internal.h"
|
||||
|
||||
/*
|
||||
* swapper_space is a fiction, retained to simplify the path through
|
||||
@@ -319,7 +320,7 @@ struct page *__read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask,
|
||||
/*
|
||||
* call radix_tree_preload() while we can wait.
|
||||
*/
|
||||
- err = radix_tree_maybe_preload(gfp_mask & GFP_KERNEL);
|
||||
+ err = radix_tree_maybe_preload(gfp_mask & GFP_RECLAIM_MASK);
|
||||
if (err)
|
||||
break;
|
||||
|
||||
diff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c
|
||||
index 9511af04dc81..15495b956855 100644
|
||||
--- a/net/netfilter/nf_conntrack_h323_main.c
|
||||
+++ b/net/netfilter/nf_conntrack_h323_main.c
|
||||
@@ -1225,6 +1225,7 @@ static struct nf_conntrack_helper nf_conntrack_helper_q931[] __read_mostly = {
|
||||
{
|
||||
.name = "Q.931",
|
||||
.me = THIS_MODULE,
|
||||
+ .data_len = sizeof(struct nf_ct_h323_master),
|
||||
.tuple.src.l3num = AF_INET6,
|
||||
.tuple.src.u.tcp.port = cpu_to_be16(Q931_PORT),
|
||||
.tuple.dst.protonum = IPPROTO_TCP,
|
||||
diff --git a/sound/usb/card.h b/sound/usb/card.h
|
||||
index 844c68863810..71778ca4b26a 100644
|
||||
--- a/sound/usb/card.h
|
||||
+++ b/sound/usb/card.h
|
||||
@@ -80,10 +80,6 @@ struct snd_usb_endpoint {
|
||||
dma_addr_t sync_dma; /* DMA address of syncbuf */
|
||||
|
||||
unsigned int pipe; /* the data i/o pipe */
|
||||
- unsigned int framesize[2]; /* small/large frame sizes in samples */
|
||||
- unsigned int sample_rem; /* remainder from division fs/fps */
|
||||
- unsigned int sample_accum; /* sample accumulator */
|
||||
- unsigned int fps; /* frames per second */
|
||||
unsigned int freqn; /* nominal sampling rate in fs/fps in Q16.16 format */
|
||||
unsigned int freqm; /* momentary sampling rate in fs/fps in Q16.16 format */
|
||||
int freqshift; /* how much to shift the feedback value to get Q16.16 */
|
||||
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
|
||||
index 666731317b33..66648b4bdd28 100644
|
||||
--- a/sound/usb/endpoint.c
|
||||
+++ b/sound/usb/endpoint.c
|
||||
@@ -137,12 +137,12 @@ int snd_usb_endpoint_implicit_feedback_sink(struct snd_usb_endpoint *ep)
|
||||
|
||||
/*
|
||||
* For streaming based on information derived from sync endpoints,
|
||||
- * prepare_outbound_urb_sizes() will call slave_next_packet_size() to
|
||||
+ * prepare_outbound_urb_sizes() will call next_packet_size() to
|
||||
* determine the number of samples to be sent in the next packet.
|
||||
*
|
||||
- * For implicit feedback, slave_next_packet_size() is unused.
|
||||
+ * For implicit feedback, next_packet_size() is unused.
|
||||
*/
|
||||
-int snd_usb_endpoint_slave_next_packet_size(struct snd_usb_endpoint *ep)
|
||||
+int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep)
|
||||
{
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
@@ -159,29 +159,6 @@ int snd_usb_endpoint_slave_next_packet_size(struct snd_usb_endpoint *ep)
|
||||
return ret;
|
||||
}
|
||||
|
||||
-/*
|
||||
- * For adaptive and synchronous endpoints, prepare_outbound_urb_sizes()
|
||||
- * will call next_packet_size() to determine the number of samples to be
|
||||
- * sent in the next packet.
|
||||
- */
|
||||
-int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep)
|
||||
-{
|
||||
- int ret;
|
||||
-
|
||||
- if (ep->fill_max)
|
||||
- return ep->maxframesize;
|
||||
-
|
||||
- ep->sample_accum += ep->sample_rem;
|
||||
- if (ep->sample_accum >= ep->fps) {
|
||||
- ep->sample_accum -= ep->fps;
|
||||
- ret = ep->framesize[1];
|
||||
- } else {
|
||||
- ret = ep->framesize[0];
|
||||
- }
|
||||
-
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
static void retire_outbound_urb(struct snd_usb_endpoint *ep,
|
||||
struct snd_urb_ctx *urb_ctx)
|
||||
{
|
||||
@@ -226,8 +203,6 @@ static void prepare_silent_urb(struct snd_usb_endpoint *ep,
|
||||
|
||||
if (ctx->packet_size[i])
|
||||
counts = ctx->packet_size[i];
|
||||
- else if (ep->sync_master)
|
||||
- counts = snd_usb_endpoint_slave_next_packet_size(ep);
|
||||
else
|
||||
counts = snd_usb_endpoint_next_packet_size(ep);
|
||||
|
||||
@@ -904,17 +879,10 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep,
|
||||
ep->maxpacksize = fmt->maxpacksize;
|
||||
ep->fill_max = !!(fmt->attributes & UAC_EP_CS_ATTR_FILL_MAX);
|
||||
|
||||
- if (snd_usb_get_speed(ep->chip->dev) == USB_SPEED_FULL) {
|
||||
+ if (snd_usb_get_speed(ep->chip->dev) == USB_SPEED_FULL)
|
||||
ep->freqn = get_usb_full_speed_rate(rate);
|
||||
- ep->fps = 1000;
|
||||
- } else {
|
||||
+ else
|
||||
ep->freqn = get_usb_high_speed_rate(rate);
|
||||
- ep->fps = 8000;
|
||||
- }
|
||||
-
|
||||
- ep->sample_rem = rate % ep->fps;
|
||||
- ep->framesize[0] = rate / ep->fps;
|
||||
- ep->framesize[1] = (rate + (ep->fps - 1)) / ep->fps;
|
||||
|
||||
/* calculate the frequency in 16.16 format */
|
||||
ep->freqm = ep->freqn;
|
||||
@@ -973,7 +941,6 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep)
|
||||
ep->active_mask = 0;
|
||||
ep->unlink_mask = 0;
|
||||
ep->phase = 0;
|
||||
- ep->sample_accum = 0;
|
||||
|
||||
snd_usb_endpoint_start_quirk(ep);
|
||||
|
||||
diff --git a/sound/usb/endpoint.h b/sound/usb/endpoint.h
|
||||
index 4aad49cbeb5f..584f295d7c77 100644
|
||||
--- a/sound/usb/endpoint.h
|
||||
+++ b/sound/usb/endpoint.h
|
||||
@@ -27,7 +27,6 @@ void snd_usb_endpoint_release(struct snd_usb_endpoint *ep);
|
||||
void snd_usb_endpoint_free(struct snd_usb_endpoint *ep);
|
||||
|
||||
int snd_usb_endpoint_implicit_feedback_sink(struct snd_usb_endpoint *ep);
|
||||
-int snd_usb_endpoint_slave_next_packet_size(struct snd_usb_endpoint *ep);
|
||||
int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep);
|
||||
|
||||
void snd_usb_handle_sync_urb(struct snd_usb_endpoint *ep,
|
||||
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
|
||||
index 53d91cae86f9..f84c55ecd0fb 100644
|
||||
--- a/sound/usb/pcm.c
|
||||
+++ b/sound/usb/pcm.c
|
||||
@@ -1473,8 +1473,6 @@ static void prepare_playback_urb(struct snd_usb_substream *subs,
|
||||
for (i = 0; i < ctx->packets; i++) {
|
||||
if (ctx->packet_size[i])
|
||||
counts = ctx->packet_size[i];
|
||||
- else if (ep->sync_master)
|
||||
- counts = snd_usb_endpoint_slave_next_packet_size(ep);
|
||||
else
|
||||
counts = snd_usb_endpoint_next_packet_size(ep);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,934 +0,0 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 8f363a3bcaf81..573b646a19936 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,6 +1,6 @@
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 4
|
||||
-SUBLEVEL = 233
|
||||
+SUBLEVEL = 234
|
||||
EXTRAVERSION =
|
||||
NAME = Blurry Fish Butt
|
||||
|
||||
diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h
|
||||
index ff4049155c840..355aec0867f4d 100644
|
||||
--- a/arch/alpha/include/asm/io.h
|
||||
+++ b/arch/alpha/include/asm/io.h
|
||||
@@ -491,10 +491,10 @@ extern inline void writeq(u64 b, volatile void __iomem *addr)
|
||||
}
|
||||
#endif
|
||||
|
||||
-#define ioread16be(p) be16_to_cpu(ioread16(p))
|
||||
-#define ioread32be(p) be32_to_cpu(ioread32(p))
|
||||
-#define iowrite16be(v,p) iowrite16(cpu_to_be16(v), (p))
|
||||
-#define iowrite32be(v,p) iowrite32(cpu_to_be32(v), (p))
|
||||
+#define ioread16be(p) swab16(ioread16(p))
|
||||
+#define ioread32be(p) swab32(ioread32(p))
|
||||
+#define iowrite16be(v,p) iowrite16(swab16(v), (p))
|
||||
+#define iowrite32be(v,p) iowrite32(swab32(v), (p))
|
||||
|
||||
#define inb_p inb
|
||||
#define inw_p inw
|
||||
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
|
||||
index e0267532bd4e0..edd392fdc14bb 100644
|
||||
--- a/arch/arm/kvm/mmu.c
|
||||
+++ b/arch/arm/kvm/mmu.c
|
||||
@@ -300,14 +300,6 @@ static void unmap_range(struct kvm *kvm, pgd_t *pgdp,
|
||||
next = kvm_pgd_addr_end(addr, end);
|
||||
if (!pgd_none(*pgd))
|
||||
unmap_puds(kvm, pgd, addr, next);
|
||||
- /*
|
||||
- * If we are dealing with a large range in
|
||||
- * stage2 table, release the kvm->mmu_lock
|
||||
- * to prevent starvation and lockup detector
|
||||
- * warnings.
|
||||
- */
|
||||
- if (kvm && (next != end))
|
||||
- cond_resched_lock(&kvm->mmu_lock);
|
||||
} while (pgd++, addr = next, addr != end);
|
||||
}
|
||||
|
||||
diff --git a/arch/m68k/include/asm/m53xxacr.h b/arch/m68k/include/asm/m53xxacr.h
|
||||
index 3177ce8331d69..baee0c77b9818 100644
|
||||
--- a/arch/m68k/include/asm/m53xxacr.h
|
||||
+++ b/arch/m68k/include/asm/m53xxacr.h
|
||||
@@ -88,9 +88,9 @@
|
||||
* coherency though in all cases. And for copyback caches we will need
|
||||
* to push cached data as well.
|
||||
*/
|
||||
-#define CACHE_INIT CACR_CINVA
|
||||
-#define CACHE_INVALIDATE CACR_CINVA
|
||||
-#define CACHE_INVALIDATED CACR_CINVA
|
||||
+#define CACHE_INIT (CACHE_MODE + CACR_CINVA - CACR_EC)
|
||||
+#define CACHE_INVALIDATE (CACHE_MODE + CACR_CINVA)
|
||||
+#define CACHE_INVALIDATED (CACHE_MODE + CACR_CINVA)
|
||||
|
||||
#define ACR0_MODE ((CONFIG_RAMBASE & 0xff000000) + \
|
||||
(0x000f0000) + \
|
||||
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
|
||||
index d1f860ca03ade..101c202c813c8 100644
|
||||
--- a/arch/powerpc/mm/fault.c
|
||||
+++ b/arch/powerpc/mm/fault.c
|
||||
@@ -192,6 +192,9 @@ static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault)
|
||||
return MM_FAULT_CONTINUE;
|
||||
}
|
||||
|
||||
+// This comes from 64-bit struct rt_sigframe + __SIGNAL_FRAMESIZE
|
||||
+#define SIGFRAME_MAX_SIZE (4096 + 128)
|
||||
+
|
||||
/*
|
||||
* For 600- and 800-family processors, the error_code parameter is DSISR
|
||||
* for a data fault, SRR1 for an instruction fault. For 400-family processors
|
||||
@@ -341,7 +344,7 @@ retry:
|
||||
/*
|
||||
* N.B. The POWER/Open ABI allows programs to access up to
|
||||
* 288 bytes below the stack pointer.
|
||||
- * The kernel signal delivery code writes up to about 1.5kB
|
||||
+ * The kernel signal delivery code writes up to about 4kB
|
||||
* below the stack pointer (r1) before decrementing it.
|
||||
* The exec code can write slightly over 640kB to the stack
|
||||
* before setting the user r1. Thus we allow the stack to
|
||||
@@ -365,7 +368,7 @@ retry:
|
||||
* between the last mapped region and the stack will
|
||||
* expand the stack rather than segfaulting.
|
||||
*/
|
||||
- if (address + 2048 < uregs->gpr[1] && !store_update_sp)
|
||||
+ if (address + SIGFRAME_MAX_SIZE < uregs->gpr[1] && !store_update_sp)
|
||||
goto bad_area;
|
||||
}
|
||||
if (expand_stack(vma, address))
|
||||
diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
|
||||
index 31ca56e593f58..b9dc2ef64ed88 100644
|
||||
--- a/drivers/gpu/drm/imx/imx-ldb.c
|
||||
+++ b/drivers/gpu/drm/imx/imx-ldb.c
|
||||
@@ -305,6 +305,7 @@ static void imx_ldb_encoder_disable(struct drm_encoder *encoder)
|
||||
{
|
||||
struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
|
||||
struct imx_ldb *ldb = imx_ldb_ch->ldb;
|
||||
+ int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN;
|
||||
int mux, ret;
|
||||
|
||||
/*
|
||||
@@ -321,14 +322,14 @@ static void imx_ldb_encoder_disable(struct drm_encoder *encoder)
|
||||
|
||||
drm_panel_disable(imx_ldb_ch->panel);
|
||||
|
||||
- if (imx_ldb_ch == &ldb->channel[0])
|
||||
+ if (imx_ldb_ch == &ldb->channel[0] || dual)
|
||||
ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK;
|
||||
- else if (imx_ldb_ch == &ldb->channel[1])
|
||||
+ if (imx_ldb_ch == &ldb->channel[1] || dual)
|
||||
ldb->ldb_ctrl &= ~LDB_CH1_MODE_EN_MASK;
|
||||
|
||||
regmap_write(ldb->regmap, IOMUXC_GPR2, ldb->ldb_ctrl);
|
||||
|
||||
- if (ldb->ldb_ctrl & LDB_SPLIT_MODE_EN) {
|
||||
+ if (dual) {
|
||||
clk_disable_unprepare(ldb->clk[0]);
|
||||
clk_disable_unprepare(ldb->clk[1]);
|
||||
}
|
||||
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
|
||||
index ad18dab0ac476..5bd9633541b07 100644
|
||||
--- a/drivers/input/mouse/psmouse-base.c
|
||||
+++ b/drivers/input/mouse/psmouse-base.c
|
||||
@@ -1911,7 +1911,7 @@ static int psmouse_get_maxproto(char *buffer, const struct kernel_param *kp)
|
||||
{
|
||||
int type = *((unsigned int *)kp->arg);
|
||||
|
||||
- return sprintf(buffer, "%s", psmouse_protocol_by_type(type)->name);
|
||||
+ return sprintf(buffer, "%s\n", psmouse_protocol_by_type(type)->name);
|
||||
}
|
||||
|
||||
static int __init psmouse_init(void)
|
||||
diff --git a/drivers/media/pci/ttpci/budget-core.c b/drivers/media/pci/ttpci/budget-core.c
|
||||
index e9674b40007c1..6107c469efa07 100644
|
||||
--- a/drivers/media/pci/ttpci/budget-core.c
|
||||
+++ b/drivers/media/pci/ttpci/budget-core.c
|
||||
@@ -386,20 +386,25 @@ static int budget_register(struct budget *budget)
|
||||
ret = dvbdemux->dmx.add_frontend(&dvbdemux->dmx, &budget->hw_frontend);
|
||||
|
||||
if (ret < 0)
|
||||
- return ret;
|
||||
+ goto err_release_dmx;
|
||||
|
||||
budget->mem_frontend.source = DMX_MEMORY_FE;
|
||||
ret = dvbdemux->dmx.add_frontend(&dvbdemux->dmx, &budget->mem_frontend);
|
||||
if (ret < 0)
|
||||
- return ret;
|
||||
+ goto err_release_dmx;
|
||||
|
||||
ret = dvbdemux->dmx.connect_frontend(&dvbdemux->dmx, &budget->hw_frontend);
|
||||
if (ret < 0)
|
||||
- return ret;
|
||||
+ goto err_release_dmx;
|
||||
|
||||
dvb_net_init(&budget->dvb_adapter, &budget->dvb_net, &dvbdemux->dmx);
|
||||
|
||||
return 0;
|
||||
+
|
||||
+err_release_dmx:
|
||||
+ dvb_dmxdev_release(&budget->dmxdev);
|
||||
+ dvb_dmx_release(&budget->demux);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static void budget_unregister(struct budget *budget)
|
||||
diff --git a/drivers/media/platform/davinci/vpss.c b/drivers/media/platform/davinci/vpss.c
|
||||
index c2c68988e38ac..9884b34d6f406 100644
|
||||
--- a/drivers/media/platform/davinci/vpss.c
|
||||
+++ b/drivers/media/platform/davinci/vpss.c
|
||||
@@ -519,19 +519,31 @@ static void vpss_exit(void)
|
||||
|
||||
static int __init vpss_init(void)
|
||||
{
|
||||
+ int ret;
|
||||
+
|
||||
if (!request_mem_region(VPSS_CLK_CTRL, 4, "vpss_clock_control"))
|
||||
return -EBUSY;
|
||||
|
||||
oper_cfg.vpss_regs_base2 = ioremap(VPSS_CLK_CTRL, 4);
|
||||
if (unlikely(!oper_cfg.vpss_regs_base2)) {
|
||||
- release_mem_region(VPSS_CLK_CTRL, 4);
|
||||
- return -ENOMEM;
|
||||
+ ret = -ENOMEM;
|
||||
+ goto err_ioremap;
|
||||
}
|
||||
|
||||
writel(VPSS_CLK_CTRL_VENCCLKEN |
|
||||
- VPSS_CLK_CTRL_DACCLKEN, oper_cfg.vpss_regs_base2);
|
||||
+ VPSS_CLK_CTRL_DACCLKEN, oper_cfg.vpss_regs_base2);
|
||||
+
|
||||
+ ret = platform_driver_register(&vpss_driver);
|
||||
+ if (ret)
|
||||
+ goto err_pd_register;
|
||||
+
|
||||
+ return 0;
|
||||
|
||||
- return platform_driver_register(&vpss_driver);
|
||||
+err_pd_register:
|
||||
+ iounmap(oper_cfg.vpss_regs_base2);
|
||||
+err_ioremap:
|
||||
+ release_mem_region(VPSS_CLK_CTRL, 4);
|
||||
+ return ret;
|
||||
}
|
||||
subsys_initcall(vpss_init);
|
||||
module_exit(vpss_exit);
|
||||
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
|
||||
index 880a9068ca126..ef06af4e3611d 100644
|
||||
--- a/drivers/scsi/libfc/fc_disc.c
|
||||
+++ b/drivers/scsi/libfc/fc_disc.c
|
||||
@@ -595,8 +595,12 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
|
||||
mutex_lock(&disc->disc_mutex);
|
||||
if (PTR_ERR(fp) == -FC_EX_CLOSED)
|
||||
goto out;
|
||||
- if (IS_ERR(fp))
|
||||
- goto redisc;
|
||||
+ if (IS_ERR(fp)) {
|
||||
+ mutex_lock(&disc->disc_mutex);
|
||||
+ fc_disc_restart(disc);
|
||||
+ mutex_unlock(&disc->disc_mutex);
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
cp = fc_frame_payload_get(fp, sizeof(*cp));
|
||||
if (!cp)
|
||||
@@ -621,7 +625,7 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
|
||||
new_rdata->disc_id = disc->disc_id;
|
||||
lport->tt.rport_login(new_rdata);
|
||||
}
|
||||
- goto out;
|
||||
+ goto free_fp;
|
||||
}
|
||||
rdata->disc_id = disc->disc_id;
|
||||
lport->tt.rport_login(rdata);
|
||||
@@ -635,6 +639,8 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
|
||||
redisc:
|
||||
fc_disc_restart(disc);
|
||||
}
|
||||
+free_fp:
|
||||
+ fc_frame_free(fp);
|
||||
out:
|
||||
mutex_unlock(&disc->disc_mutex);
|
||||
kref_put(&rdata->kref, lport->tt.rport_destroy);
|
||||
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
|
||||
index 9200a8668b498..a57c3a5f4bf8b 100644
|
||||
--- a/drivers/video/fbdev/omap2/dss/dss.c
|
||||
+++ b/drivers/video/fbdev/omap2/dss/dss.c
|
||||
@@ -843,7 +843,7 @@ static const struct dss_features omap34xx_dss_feats = {
|
||||
};
|
||||
|
||||
static const struct dss_features omap3630_dss_feats = {
|
||||
- .fck_div_max = 32,
|
||||
+ .fck_div_max = 31,
|
||||
.dss_fck_multiplier = 1,
|
||||
.parent_clk_name = "dpll4_ck",
|
||||
.dpi_select_source = &dss_dpi_select_source_omap2_omap3,
|
||||
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
|
||||
index a01a41a412693..6b3565feddb21 100644
|
||||
--- a/drivers/virtio/virtio_ring.c
|
||||
+++ b/drivers/virtio/virtio_ring.c
|
||||
@@ -603,6 +603,9 @@ bool virtqueue_poll(struct virtqueue *_vq, unsigned last_used_idx)
|
||||
{
|
||||
struct vring_virtqueue *vq = to_vvq(_vq);
|
||||
|
||||
+ if (unlikely(vq->broken))
|
||||
+ return false;
|
||||
+
|
||||
virtio_mb(vq->weak_barriers);
|
||||
return (u16)last_used_idx != virtio16_to_cpu(_vq->vdev, vq->vring.used->idx);
|
||||
}
|
||||
diff --git a/drivers/watchdog/f71808e_wdt.c b/drivers/watchdog/f71808e_wdt.c
|
||||
index 2048aad91add8..2b12ef019ae02 100644
|
||||
--- a/drivers/watchdog/f71808e_wdt.c
|
||||
+++ b/drivers/watchdog/f71808e_wdt.c
|
||||
@@ -642,9 +642,9 @@ static int __init watchdog_init(int sioaddr)
|
||||
* into the module have been registered yet.
|
||||
*/
|
||||
watchdog.sioaddr = sioaddr;
|
||||
- watchdog.ident.options = WDIOC_SETTIMEOUT
|
||||
- | WDIOF_MAGICCLOSE
|
||||
- | WDIOF_KEEPALIVEPING;
|
||||
+ watchdog.ident.options = WDIOF_MAGICCLOSE
|
||||
+ | WDIOF_KEEPALIVEPING
|
||||
+ | WDIOF_CARDRESET;
|
||||
|
||||
snprintf(watchdog.ident.identity,
|
||||
sizeof(watchdog.ident.identity), "%s watchdog",
|
||||
diff --git a/drivers/xen/preempt.c b/drivers/xen/preempt.c
|
||||
index 5f6b77ea34fb5..128375ff80b8c 100644
|
||||
--- a/drivers/xen/preempt.c
|
||||
+++ b/drivers/xen/preempt.c
|
||||
@@ -31,7 +31,7 @@ EXPORT_SYMBOL_GPL(xen_in_preemptible_hcall);
|
||||
asmlinkage __visible void xen_maybe_preempt_hcall(void)
|
||||
{
|
||||
if (unlikely(__this_cpu_read(xen_in_preemptible_hcall)
|
||||
- && need_resched())) {
|
||||
+ && need_resched() && !preempt_count())) {
|
||||
/*
|
||||
* Clear flag as we may be rescheduled on a different
|
||||
* cpu.
|
||||
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
|
||||
index 0b06d4942da77..8fb9a1e0048be 100644
|
||||
--- a/fs/btrfs/ctree.h
|
||||
+++ b/fs/btrfs/ctree.h
|
||||
@@ -4096,6 +4096,8 @@ ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size);
|
||||
/* super.c */
|
||||
int btrfs_parse_options(struct btrfs_root *root, char *options);
|
||||
int btrfs_sync_fs(struct super_block *sb, int wait);
|
||||
+char *btrfs_get_subvol_name_from_objectid(struct btrfs_fs_info *fs_info,
|
||||
+ u64 subvol_objectid);
|
||||
|
||||
#ifdef CONFIG_PRINTK
|
||||
__printf(2, 3)
|
||||
diff --git a/fs/btrfs/export.c b/fs/btrfs/export.c
|
||||
index 2513a7f533342..92f80ed642194 100644
|
||||
--- a/fs/btrfs/export.c
|
||||
+++ b/fs/btrfs/export.c
|
||||
@@ -55,9 +55,9 @@ static int btrfs_encode_fh(struct inode *inode, u32 *fh, int *max_len,
|
||||
return type;
|
||||
}
|
||||
|
||||
-static struct dentry *btrfs_get_dentry(struct super_block *sb, u64 objectid,
|
||||
- u64 root_objectid, u32 generation,
|
||||
- int check_generation)
|
||||
+struct dentry *btrfs_get_dentry(struct super_block *sb, u64 objectid,
|
||||
+ u64 root_objectid, u32 generation,
|
||||
+ int check_generation)
|
||||
{
|
||||
struct btrfs_fs_info *fs_info = btrfs_sb(sb);
|
||||
struct btrfs_root *root;
|
||||
@@ -150,7 +150,7 @@ static struct dentry *btrfs_fh_to_dentry(struct super_block *sb, struct fid *fh,
|
||||
return btrfs_get_dentry(sb, objectid, root_objectid, generation, 1);
|
||||
}
|
||||
|
||||
-static struct dentry *btrfs_get_parent(struct dentry *child)
|
||||
+struct dentry *btrfs_get_parent(struct dentry *child)
|
||||
{
|
||||
struct inode *dir = d_inode(child);
|
||||
struct btrfs_root *root = BTRFS_I(dir)->root;
|
||||
diff --git a/fs/btrfs/export.h b/fs/btrfs/export.h
|
||||
index 074348a95841f..7a305e5549991 100644
|
||||
--- a/fs/btrfs/export.h
|
||||
+++ b/fs/btrfs/export.h
|
||||
@@ -16,4 +16,9 @@ struct btrfs_fid {
|
||||
u64 parent_root_objectid;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
+struct dentry *btrfs_get_dentry(struct super_block *sb, u64 objectid,
|
||||
+ u64 root_objectid, u32 generation,
|
||||
+ int check_generation);
|
||||
+struct dentry *btrfs_get_parent(struct dentry *child);
|
||||
+
|
||||
#endif
|
||||
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
|
||||
index 404051bf5cba9..77e6ce0e1e351 100644
|
||||
--- a/fs/btrfs/super.c
|
||||
+++ b/fs/btrfs/super.c
|
||||
@@ -843,8 +843,8 @@ out:
|
||||
return error;
|
||||
}
|
||||
|
||||
-static char *get_subvol_name_from_objectid(struct btrfs_fs_info *fs_info,
|
||||
- u64 subvol_objectid)
|
||||
+char *btrfs_get_subvol_name_from_objectid(struct btrfs_fs_info *fs_info,
|
||||
+ u64 subvol_objectid)
|
||||
{
|
||||
struct btrfs_root *root = fs_info->tree_root;
|
||||
struct btrfs_root *fs_root;
|
||||
@@ -1120,6 +1120,7 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry)
|
||||
struct btrfs_fs_info *info = btrfs_sb(dentry->d_sb);
|
||||
struct btrfs_root *root = info->tree_root;
|
||||
char *compress_type;
|
||||
+ const char *subvol_name;
|
||||
|
||||
if (btrfs_test_opt(root, DEGRADED))
|
||||
seq_puts(seq, ",degraded");
|
||||
@@ -1204,8 +1205,13 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry)
|
||||
#endif
|
||||
seq_printf(seq, ",subvolid=%llu",
|
||||
BTRFS_I(d_inode(dentry))->root->root_key.objectid);
|
||||
- seq_puts(seq, ",subvol=");
|
||||
- seq_dentry(seq, dentry, " \t\n\\");
|
||||
+ subvol_name = btrfs_get_subvol_name_from_objectid(info,
|
||||
+ BTRFS_I(d_inode(dentry))->root->root_key.objectid);
|
||||
+ if (!IS_ERR(subvol_name)) {
|
||||
+ seq_puts(seq, ",subvol=");
|
||||
+ seq_escape(seq, subvol_name, " \t\n\\");
|
||||
+ kfree(subvol_name);
|
||||
+ }
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1323,8 +1329,8 @@ static struct dentry *mount_subvol(const char *subvol_name, u64 subvol_objectid,
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
- subvol_name = get_subvol_name_from_objectid(btrfs_sb(mnt->mnt_sb),
|
||||
- subvol_objectid);
|
||||
+ subvol_name = btrfs_get_subvol_name_from_objectid(
|
||||
+ btrfs_sb(mnt->mnt_sb), subvol_objectid);
|
||||
if (IS_ERR(subvol_name)) {
|
||||
root = ERR_CAST(subvol_name);
|
||||
subvol_name = NULL;
|
||||
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
|
||||
index 240d9ceb8d0c6..b8959d0d4c723 100644
|
||||
--- a/fs/eventpoll.c
|
||||
+++ b/fs/eventpoll.c
|
||||
@@ -1719,9 +1719,11 @@ static int ep_loop_check_proc(void *priv, void *cookie, int call_nests)
|
||||
* not already there, and calling reverse_path_check()
|
||||
* during ep_insert().
|
||||
*/
|
||||
- if (list_empty(&epi->ffd.file->f_tfile_llink))
|
||||
+ if (list_empty(&epi->ffd.file->f_tfile_llink)) {
|
||||
+ get_file(epi->ffd.file);
|
||||
list_add(&epi->ffd.file->f_tfile_llink,
|
||||
&tfile_check_list);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
mutex_unlock(&ep->mtx);
|
||||
@@ -1765,6 +1767,7 @@ static void clear_tfile_check_list(void)
|
||||
file = list_first_entry(&tfile_check_list, struct file,
|
||||
f_tfile_llink);
|
||||
list_del_init(&file->f_tfile_llink);
|
||||
+ fput(file);
|
||||
}
|
||||
INIT_LIST_HEAD(&tfile_check_list);
|
||||
}
|
||||
@@ -1902,13 +1905,13 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
|
||||
mutex_lock(&epmutex);
|
||||
if (is_file_epoll(tf.file)) {
|
||||
error = -ELOOP;
|
||||
- if (ep_loop_check(ep, tf.file) != 0) {
|
||||
- clear_tfile_check_list();
|
||||
+ if (ep_loop_check(ep, tf.file) != 0)
|
||||
goto error_tgt_fput;
|
||||
- }
|
||||
- } else
|
||||
+ } else {
|
||||
+ get_file(tf.file);
|
||||
list_add(&tf.file->f_tfile_llink,
|
||||
&tfile_check_list);
|
||||
+ }
|
||||
mutex_lock_nested(&ep->mtx, 0);
|
||||
if (is_file_epoll(tf.file)) {
|
||||
tep = tf.file->private_data;
|
||||
@@ -1932,8 +1935,6 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
|
||||
error = ep_insert(ep, &epds, tf.file, fd, full_check);
|
||||
} else
|
||||
error = -EEXIST;
|
||||
- if (full_check)
|
||||
- clear_tfile_check_list();
|
||||
break;
|
||||
case EPOLL_CTL_DEL:
|
||||
if (epi)
|
||||
@@ -1954,8 +1955,10 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
|
||||
mutex_unlock(&ep->mtx);
|
||||
|
||||
error_tgt_fput:
|
||||
- if (full_check)
|
||||
+ if (full_check) {
|
||||
+ clear_tfile_check_list();
|
||||
mutex_unlock(&epmutex);
|
||||
+ }
|
||||
|
||||
fdput(tf);
|
||||
error_fput:
|
||||
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
|
||||
index 566a8b08ccdd6..061b026e464c5 100644
|
||||
--- a/fs/ext4/namei.c
|
||||
+++ b/fs/ext4/namei.c
|
||||
@@ -1226,19 +1226,18 @@ static void dx_insert_block(struct dx_frame *frame, u32 hash, ext4_lblk_t block)
|
||||
}
|
||||
|
||||
/*
|
||||
- * NOTE! unlike strncmp, ext4_match returns 1 for success, 0 for failure.
|
||||
+ * Test whether a directory entry matches the filename being searched for.
|
||||
*
|
||||
- * `len <= EXT4_NAME_LEN' is guaranteed by caller.
|
||||
- * `de != NULL' is guaranteed by caller.
|
||||
+ * Return: %true if the directory entry matches, otherwise %false.
|
||||
*/
|
||||
-static inline int ext4_match(struct ext4_filename *fname,
|
||||
- struct ext4_dir_entry_2 *de)
|
||||
+static inline bool ext4_match(const struct ext4_filename *fname,
|
||||
+ const struct ext4_dir_entry_2 *de)
|
||||
{
|
||||
const void *name = fname_name(fname);
|
||||
u32 len = fname_len(fname);
|
||||
|
||||
if (!de->inode)
|
||||
- return 0;
|
||||
+ return false;
|
||||
|
||||
#ifdef CONFIG_EXT4_FS_ENCRYPTION
|
||||
if (unlikely(!name)) {
|
||||
@@ -1270,48 +1269,31 @@ int ext4_search_dir(struct buffer_head *bh, char *search_buf, int buf_size,
|
||||
struct ext4_dir_entry_2 * de;
|
||||
char * dlimit;
|
||||
int de_len;
|
||||
- int res;
|
||||
|
||||
de = (struct ext4_dir_entry_2 *)search_buf;
|
||||
dlimit = search_buf + buf_size;
|
||||
while ((char *) de < dlimit) {
|
||||
/* this code is executed quadratically often */
|
||||
/* do minimal checking `by hand' */
|
||||
- if ((char *) de + de->name_len <= dlimit) {
|
||||
- res = ext4_match(fname, de);
|
||||
- if (res < 0) {
|
||||
- res = -1;
|
||||
- goto return_result;
|
||||
- }
|
||||
- if (res > 0) {
|
||||
- /* found a match - just to be sure, do
|
||||
- * a full check */
|
||||
- if (ext4_check_dir_entry(dir, NULL, de, bh,
|
||||
- bh->b_data,
|
||||
- bh->b_size, offset)) {
|
||||
- res = -1;
|
||||
- goto return_result;
|
||||
- }
|
||||
- *res_dir = de;
|
||||
- res = 1;
|
||||
- goto return_result;
|
||||
- }
|
||||
-
|
||||
+ if ((char *) de + de->name_len <= dlimit &&
|
||||
+ ext4_match(fname, de)) {
|
||||
+ /* found a match - just to be sure, do
|
||||
+ * a full check */
|
||||
+ if (ext4_check_dir_entry(dir, NULL, de, bh, search_buf,
|
||||
+ buf_size, offset))
|
||||
+ return -1;
|
||||
+ *res_dir = de;
|
||||
+ return 1;
|
||||
}
|
||||
/* prevent looping on a bad block */
|
||||
de_len = ext4_rec_len_from_disk(de->rec_len,
|
||||
dir->i_sb->s_blocksize);
|
||||
- if (de_len <= 0) {
|
||||
- res = -1;
|
||||
- goto return_result;
|
||||
- }
|
||||
+ if (de_len <= 0)
|
||||
+ return -1;
|
||||
offset += de_len;
|
||||
de = (struct ext4_dir_entry_2 *) ((char *) de + de_len);
|
||||
}
|
||||
-
|
||||
- res = 0;
|
||||
-return_result:
|
||||
- return res;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static int is_dx_internal_node(struct inode *dir, ext4_lblk_t block,
|
||||
@@ -1748,7 +1730,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
|
||||
blocksize, hinfo, map);
|
||||
map -= count;
|
||||
dx_sort_map(map, count);
|
||||
- /* Split the existing block in the middle, size-wise */
|
||||
+ /* Ensure that neither split block is over half full */
|
||||
size = 0;
|
||||
move = 0;
|
||||
for (i = count-1; i >= 0; i--) {
|
||||
@@ -1758,8 +1740,18 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
|
||||
size += map[i].size;
|
||||
move++;
|
||||
}
|
||||
- /* map index at which we will split */
|
||||
- split = count - move;
|
||||
+ /*
|
||||
+ * map index at which we will split
|
||||
+ *
|
||||
+ * If the sum of active entries didn't exceed half the block size, just
|
||||
+ * split it in half by count; each resulting block will have at least
|
||||
+ * half the space free.
|
||||
+ */
|
||||
+ if (i > 0)
|
||||
+ split = count - move;
|
||||
+ else
|
||||
+ split = count/2;
|
||||
+
|
||||
hash2 = map[split].hash;
|
||||
continued = hash2 == map[split - 1].hash;
|
||||
dxtrace(printk(KERN_INFO "Split block %lu at %x, %i/%i\n",
|
||||
@@ -1824,24 +1816,15 @@ int ext4_find_dest_de(struct inode *dir, struct inode *inode,
|
||||
int nlen, rlen;
|
||||
unsigned int offset = 0;
|
||||
char *top;
|
||||
- int res;
|
||||
|
||||
de = (struct ext4_dir_entry_2 *)buf;
|
||||
top = buf + buf_size - reclen;
|
||||
while ((char *) de <= top) {
|
||||
if (ext4_check_dir_entry(dir, NULL, de, bh,
|
||||
- buf, buf_size, offset)) {
|
||||
- res = -EFSCORRUPTED;
|
||||
- goto return_result;
|
||||
- }
|
||||
- /* Provide crypto context and crypto buffer to ext4 match */
|
||||
- res = ext4_match(fname, de);
|
||||
- if (res < 0)
|
||||
- goto return_result;
|
||||
- if (res > 0) {
|
||||
- res = -EEXIST;
|
||||
- goto return_result;
|
||||
- }
|
||||
+ buf, buf_size, offset))
|
||||
+ return -EFSCORRUPTED;
|
||||
+ if (ext4_match(fname, de))
|
||||
+ return -EEXIST;
|
||||
nlen = EXT4_DIR_REC_LEN(de->name_len);
|
||||
rlen = ext4_rec_len_from_disk(de->rec_len, buf_size);
|
||||
if ((de->inode ? rlen - nlen : rlen) >= reclen)
|
||||
@@ -1849,15 +1832,11 @@ int ext4_find_dest_de(struct inode *dir, struct inode *inode,
|
||||
de = (struct ext4_dir_entry_2 *)((char *)de + rlen);
|
||||
offset += rlen;
|
||||
}
|
||||
-
|
||||
if ((char *) de > top)
|
||||
- res = -ENOSPC;
|
||||
- else {
|
||||
- *dest_de = de;
|
||||
- res = 0;
|
||||
- }
|
||||
-return_result:
|
||||
- return res;
|
||||
+ return -ENOSPC;
|
||||
+
|
||||
+ *dest_de = de;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
int ext4_insert_dentry(struct inode *dir,
|
||||
@@ -2343,7 +2322,7 @@ int ext4_generic_delete_entry(handle_t *handle,
|
||||
de = (struct ext4_dir_entry_2 *)entry_buf;
|
||||
while (i < buf_size - csum_size) {
|
||||
if (ext4_check_dir_entry(dir, NULL, de, bh,
|
||||
- bh->b_data, bh->b_size, i))
|
||||
+ entry_buf, buf_size, i))
|
||||
return -EFSCORRUPTED;
|
||||
if (de == de_del) {
|
||||
if (pde)
|
||||
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c
|
||||
index e273171696972..7a3368929245d 100644
|
||||
--- a/fs/jffs2/dir.c
|
||||
+++ b/fs/jffs2/dir.c
|
||||
@@ -588,10 +588,14 @@ static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry)
|
||||
int ret;
|
||||
uint32_t now = get_seconds();
|
||||
|
||||
+ mutex_lock(&f->sem);
|
||||
for (fd = f->dents ; fd; fd = fd->next) {
|
||||
- if (fd->ino)
|
||||
+ if (fd->ino) {
|
||||
+ mutex_unlock(&f->sem);
|
||||
return -ENOTEMPTY;
|
||||
+ }
|
||||
}
|
||||
+ mutex_unlock(&f->sem);
|
||||
|
||||
ret = jffs2_do_unlink(c, dir_f, dentry->d_name.name,
|
||||
dentry->d_name.len, f, now);
|
||||
diff --git a/fs/romfs/storage.c b/fs/romfs/storage.c
|
||||
index f86f51f99aceb..1dcadd22b440d 100644
|
||||
--- a/fs/romfs/storage.c
|
||||
+++ b/fs/romfs/storage.c
|
||||
@@ -221,10 +221,8 @@ int romfs_dev_read(struct super_block *sb, unsigned long pos,
|
||||
size_t limit;
|
||||
|
||||
limit = romfs_maxsize(sb);
|
||||
- if (pos >= limit)
|
||||
+ if (pos >= limit || buflen > limit - pos)
|
||||
return -EIO;
|
||||
- if (buflen > limit - pos)
|
||||
- buflen = limit - pos;
|
||||
|
||||
#ifdef CONFIG_ROMFS_ON_MTD
|
||||
if (sb->s_mtd)
|
||||
diff --git a/fs/xfs/xfs_sysfs.h b/fs/xfs/xfs_sysfs.h
|
||||
index be692e59938db..c457b010c623d 100644
|
||||
--- a/fs/xfs/xfs_sysfs.h
|
||||
+++ b/fs/xfs/xfs_sysfs.h
|
||||
@@ -44,9 +44,11 @@ xfs_sysfs_init(
|
||||
struct xfs_kobj *parent_kobj,
|
||||
const char *name)
|
||||
{
|
||||
+ struct kobject *parent;
|
||||
+
|
||||
+ parent = parent_kobj ? &parent_kobj->kobject : NULL;
|
||||
init_completion(&kobj->complete);
|
||||
- return kobject_init_and_add(&kobj->kobject, ktype,
|
||||
- &parent_kobj->kobject, "%s", name);
|
||||
+ return kobject_init_and_add(&kobj->kobject, ktype, parent, "%s", name);
|
||||
}
|
||||
|
||||
static inline void
|
||||
diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c
|
||||
index ce78534a047ee..bb8de2dddabe2 100644
|
||||
--- a/fs/xfs/xfs_trans_dquot.c
|
||||
+++ b/fs/xfs/xfs_trans_dquot.c
|
||||
@@ -662,7 +662,7 @@ xfs_trans_dqresv(
|
||||
}
|
||||
}
|
||||
if (ninos > 0) {
|
||||
- total_count = be64_to_cpu(dqp->q_core.d_icount) + ninos;
|
||||
+ total_count = dqp->q_res_icount + ninos;
|
||||
timer = be32_to_cpu(dqp->q_core.d_itimer);
|
||||
warns = be16_to_cpu(dqp->q_core.d_iwarns);
|
||||
warnlimit = dqp->q_mount->m_quotainfo->qi_iwarnlimit;
|
||||
diff --git a/include/linux/mm.h b/include/linux/mm.h
|
||||
index 03cf5526e4456..2b17d2fca4299 100644
|
||||
--- a/include/linux/mm.h
|
||||
+++ b/include/linux/mm.h
|
||||
@@ -1123,6 +1123,10 @@ void unmap_vmas(struct mmu_gather *tlb, struct vm_area_struct *start_vma,
|
||||
* followed by taking the mmap_sem for writing before modifying the
|
||||
* vmas or anything the coredump pretends not to change from under it.
|
||||
*
|
||||
+ * It also has to be called when mmgrab() is used in the context of
|
||||
+ * the process, but then the mm_count refcount is transferred outside
|
||||
+ * the context of the process to run down_write() on that pinned mm.
|
||||
+ *
|
||||
* NOTE: find_extend_vma() called from GUP context is the only place
|
||||
* that can modify the "mm" (notably the vm_start/end) under mmap_sem
|
||||
* for reading and outside the context of the process, so it is also
|
||||
diff --git a/include/net/sock.h b/include/net/sock.h
|
||||
index 426a57874964c..31198b32d9122 100644
|
||||
--- a/include/net/sock.h
|
||||
+++ b/include/net/sock.h
|
||||
@@ -779,6 +779,8 @@ static inline int sk_memalloc_socks(void)
|
||||
{
|
||||
return static_key_false(&memalloc_socks);
|
||||
}
|
||||
+
|
||||
+void __receive_sock(struct file *file);
|
||||
#else
|
||||
|
||||
static inline int sk_memalloc_socks(void)
|
||||
@@ -786,6 +788,8 @@ static inline int sk_memalloc_socks(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static inline void __receive_sock(struct file *file)
|
||||
+{ }
|
||||
#endif
|
||||
|
||||
static inline gfp_t sk_gfp_atomic(const struct sock *sk, gfp_t gfp_mask)
|
||||
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
|
||||
index 465786cd6490e..f38d24bb8a1bc 100644
|
||||
--- a/mm/huge_memory.c
|
||||
+++ b/mm/huge_memory.c
|
||||
@@ -2136,7 +2136,7 @@ static void insert_to_mm_slots_hash(struct mm_struct *mm,
|
||||
|
||||
static inline int khugepaged_test_exit(struct mm_struct *mm)
|
||||
{
|
||||
- return atomic_read(&mm->mm_users) == 0;
|
||||
+ return atomic_read(&mm->mm_users) == 0 || !mmget_still_valid(mm);
|
||||
}
|
||||
|
||||
int __khugepaged_enter(struct mm_struct *mm)
|
||||
@@ -2149,7 +2149,7 @@ int __khugepaged_enter(struct mm_struct *mm)
|
||||
return -ENOMEM;
|
||||
|
||||
/* __khugepaged_exit() must not run from under us */
|
||||
- VM_BUG_ON_MM(khugepaged_test_exit(mm), mm);
|
||||
+ VM_BUG_ON_MM(atomic_read(&mm->mm_users) == 0, mm);
|
||||
if (unlikely(test_and_set_bit(MMF_VM_HUGEPAGE, &mm->flags))) {
|
||||
free_mm_slot(mm_slot);
|
||||
return 0;
|
||||
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
|
||||
index 3a1501e854832..baac9a09ec0a1 100644
|
||||
--- a/mm/hugetlb.c
|
||||
+++ b/mm/hugetlb.c
|
||||
@@ -4257,6 +4257,7 @@ static bool vma_shareable(struct vm_area_struct *vma, unsigned long addr)
|
||||
return false;
|
||||
}
|
||||
|
||||
+#define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a))
|
||||
/*
|
||||
* Determine if start,end range within vma could be mapped by shared pmd.
|
||||
* If yes, adjust start and end to cover range associated with possible
|
||||
@@ -4265,25 +4266,21 @@ static bool vma_shareable(struct vm_area_struct *vma, unsigned long addr)
|
||||
void adjust_range_if_pmd_sharing_possible(struct vm_area_struct *vma,
|
||||
unsigned long *start, unsigned long *end)
|
||||
{
|
||||
- unsigned long check_addr = *start;
|
||||
+ unsigned long a_start, a_end;
|
||||
|
||||
if (!(vma->vm_flags & VM_MAYSHARE))
|
||||
return;
|
||||
|
||||
- for (check_addr = *start; check_addr < *end; check_addr += PUD_SIZE) {
|
||||
- unsigned long a_start = check_addr & PUD_MASK;
|
||||
- unsigned long a_end = a_start + PUD_SIZE;
|
||||
+ /* Extend the range to be PUD aligned for a worst case scenario */
|
||||
+ a_start = ALIGN_DOWN(*start, PUD_SIZE);
|
||||
+ a_end = ALIGN(*end, PUD_SIZE);
|
||||
|
||||
- /*
|
||||
- * If sharing is possible, adjust start/end if necessary.
|
||||
- */
|
||||
- if (range_in_vma(vma, a_start, a_end)) {
|
||||
- if (a_start < *start)
|
||||
- *start = a_start;
|
||||
- if (a_end > *end)
|
||||
- *end = a_end;
|
||||
- }
|
||||
- }
|
||||
+ /*
|
||||
+ * Intersect the range with the vma range, since pmd sharing won't be
|
||||
+ * across vma after all
|
||||
+ */
|
||||
+ *start = max(vma->vm_start, a_start);
|
||||
+ *end = min(vma->vm_end, a_end);
|
||||
}
|
||||
|
||||
/*
|
||||
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
|
||||
index df589416ace6c..14bab5fa1b656 100644
|
||||
--- a/mm/page_alloc.c
|
||||
+++ b/mm/page_alloc.c
|
||||
@@ -843,6 +843,11 @@ static void free_pcppages_bulk(struct zone *zone, int count,
|
||||
if (nr_scanned)
|
||||
__mod_zone_page_state(zone, NR_PAGES_SCANNED, -nr_scanned);
|
||||
|
||||
+ /*
|
||||
+ * Ensure proper count is passed which otherwise would stuck in the
|
||||
+ * below while (list_empty(list)) loop.
|
||||
+ */
|
||||
+ count = min(pcp->count, count);
|
||||
while (to_free) {
|
||||
struct page *page;
|
||||
struct list_head *list;
|
||||
@@ -6285,7 +6290,7 @@ int __meminit init_per_zone_wmark_min(void)
|
||||
setup_per_zone_inactive_ratio();
|
||||
return 0;
|
||||
}
|
||||
-core_initcall(init_per_zone_wmark_min)
|
||||
+postcore_initcall(init_per_zone_wmark_min)
|
||||
|
||||
/*
|
||||
* min_free_kbytes_sysctl_handler - just a wrapper around proc_dointvec() so
|
||||
diff --git a/net/compat.c b/net/compat.c
|
||||
index d676840104556..20c5e5f215f23 100644
|
||||
--- a/net/compat.c
|
||||
+++ b/net/compat.c
|
||||
@@ -284,6 +284,7 @@ void scm_detach_fds_compat(struct msghdr *kmsg, struct scm_cookie *scm)
|
||||
break;
|
||||
}
|
||||
/* Bump the usage count and install the file. */
|
||||
+ __receive_sock(fp[i]);
|
||||
fd_install(new_fd, get_file(fp[i]));
|
||||
}
|
||||
|
||||
diff --git a/net/core/sock.c b/net/core/sock.c
|
||||
index 120d5058d81ae..82f9a7dbea6fe 100644
|
||||
--- a/net/core/sock.c
|
||||
+++ b/net/core/sock.c
|
||||
@@ -2275,6 +2275,27 @@ int sock_no_mmap(struct file *file, struct socket *sock, struct vm_area_struct *
|
||||
}
|
||||
EXPORT_SYMBOL(sock_no_mmap);
|
||||
|
||||
+/*
|
||||
+ * When a file is received (via SCM_RIGHTS, etc), we must bump the
|
||||
+ * various sock-based usage counts.
|
||||
+ */
|
||||
+void __receive_sock(struct file *file)
|
||||
+{
|
||||
+ struct socket *sock;
|
||||
+ int error;
|
||||
+
|
||||
+ /*
|
||||
+ * The resulting value of "error" is ignored here since we only
|
||||
+ * need to take action when the file is a socket and testing
|
||||
+ * "sock" for NULL is sufficient.
|
||||
+ */
|
||||
+ sock = sock_from_file(file, &error);
|
||||
+ if (sock) {
|
||||
+ sock_update_netprioidx(sock->sk);
|
||||
+ sock_update_classid(sock->sk);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
ssize_t sock_no_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags)
|
||||
{
|
||||
ssize_t res;
|
||||
diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
|
||||
index 1d9dfb92b3b48..edb244331e6e9 100644
|
||||
--- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c
|
||||
+++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
|
||||
@@ -338,7 +338,7 @@ static int sst_media_open(struct snd_pcm_substream *substream,
|
||||
|
||||
ret_val = power_up_sst(stream);
|
||||
if (ret_val < 0)
|
||||
- return ret_val;
|
||||
+ goto out_power_up;
|
||||
|
||||
/* Make sure, that the period size is always even */
|
||||
snd_pcm_hw_constraint_step(substream->runtime, 0,
|
||||
@@ -347,8 +347,9 @@ static int sst_media_open(struct snd_pcm_substream *substream,
|
||||
return snd_pcm_hw_constraint_integer(runtime,
|
||||
SNDRV_PCM_HW_PARAM_PERIODS);
|
||||
out_ops:
|
||||
- kfree(stream);
|
||||
mutex_unlock(&sst_lock);
|
||||
+out_power_up:
|
||||
+ kfree(stream);
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
|
||||
index c694f10d004cc..1b73537af91db 100644
|
||||
--- a/tools/perf/util/probe-finder.c
|
||||
+++ b/tools/perf/util/probe-finder.c
|
||||
@@ -1274,7 +1274,7 @@ int debuginfo__find_trace_events(struct debuginfo *dbg,
|
||||
tf.ntevs = 0;
|
||||
|
||||
ret = debuginfo__find_probes(dbg, &tf.pf);
|
||||
- if (ret < 0) {
|
||||
+ if (ret < 0 || tf.ntevs == 0) {
|
||||
for (i = 0; i < tf.ntevs; i++)
|
||||
clear_probe_trace_event(&tf.tevs[i]);
|
||||
zfree(tevs);
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,555 +0,0 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 74072b5a958b2..69e7cd30e6465 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,6 +1,6 @@
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 4
|
||||
-SUBLEVEL = 239
|
||||
+SUBLEVEL = 240
|
||||
EXTRAVERSION =
|
||||
NAME = Blurry Fish Butt
|
||||
|
||||
diff --git a/drivers/crypto/qat/qat_common/qat_algs.c b/drivers/crypto/qat/qat_common/qat_algs.c
|
||||
index 367b6661ee041..4dda526bd21b8 100644
|
||||
--- a/drivers/crypto/qat/qat_common/qat_algs.c
|
||||
+++ b/drivers/crypto/qat/qat_common/qat_algs.c
|
||||
@@ -822,6 +822,11 @@ static int qat_alg_aead_dec(struct aead_request *areq)
|
||||
struct icp_qat_fw_la_bulk_req *msg;
|
||||
int digst_size = crypto_aead_authsize(aead_tfm);
|
||||
int ret, ctr = 0;
|
||||
+ u32 cipher_len;
|
||||
+
|
||||
+ cipher_len = areq->cryptlen - digst_size;
|
||||
+ if (cipher_len % AES_BLOCK_SIZE != 0)
|
||||
+ return -EINVAL;
|
||||
|
||||
ret = qat_alg_sgl_to_bufl(ctx->inst, areq->src, areq->dst, qat_req);
|
||||
if (unlikely(ret))
|
||||
@@ -836,7 +841,7 @@ static int qat_alg_aead_dec(struct aead_request *areq)
|
||||
qat_req->req.comn_mid.src_data_addr = qat_req->buf.blp;
|
||||
qat_req->req.comn_mid.dest_data_addr = qat_req->buf.bloutp;
|
||||
cipher_param = (void *)&qat_req->req.serv_specif_rqpars;
|
||||
- cipher_param->cipher_length = areq->cryptlen - digst_size;
|
||||
+ cipher_param->cipher_length = cipher_len;
|
||||
cipher_param->cipher_offset = areq->assoclen;
|
||||
memcpy(cipher_param->u.cipher_IV_array, areq->iv, AES_BLOCK_SIZE);
|
||||
auth_param = (void *)((uint8_t *)cipher_param + sizeof(*cipher_param));
|
||||
@@ -865,6 +870,9 @@ static int qat_alg_aead_enc(struct aead_request *areq)
|
||||
uint8_t *iv = areq->iv;
|
||||
int ret, ctr = 0;
|
||||
|
||||
+ if (areq->cryptlen % AES_BLOCK_SIZE != 0)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
ret = qat_alg_sgl_to_bufl(ctx->inst, areq->src, areq->dst, qat_req);
|
||||
if (unlikely(ret))
|
||||
return ret;
|
||||
diff --git a/drivers/media/usb/usbtv/usbtv-core.c b/drivers/media/usb/usbtv/usbtv-core.c
|
||||
index a2eb87d74656f..8a1440a573a33 100644
|
||||
--- a/drivers/media/usb/usbtv/usbtv-core.c
|
||||
+++ b/drivers/media/usb/usbtv/usbtv-core.c
|
||||
@@ -96,7 +96,8 @@ static int usbtv_probe(struct usb_interface *intf,
|
||||
|
||||
usbtv_audio_fail:
|
||||
/* we must not free at this point */
|
||||
- usb_get_dev(usbtv->udev);
|
||||
+ v4l2_device_get(&usbtv->v4l2_dev);
|
||||
+ /* this will undo the v4l2_device_get() */
|
||||
usbtv_video_free(usbtv);
|
||||
|
||||
usbtv_video_fail:
|
||||
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
|
||||
index 57001f8f727a3..6ed2959ce4dc0 100644
|
||||
--- a/drivers/spi/spi.c
|
||||
+++ b/drivers/spi/spi.c
|
||||
@@ -1917,13 +1917,13 @@ static int __unregister(struct device *dev, void *null)
|
||||
*/
|
||||
void spi_unregister_master(struct spi_master *master)
|
||||
{
|
||||
+ device_for_each_child(&master->dev, NULL, __unregister);
|
||||
+
|
||||
if (master->queued) {
|
||||
if (spi_destroy_queue(master))
|
||||
dev_err(&master->dev, "queue remove failed\n");
|
||||
}
|
||||
|
||||
- device_for_each_child(&master->dev, NULL, __unregister);
|
||||
-
|
||||
mutex_lock(&board_lock);
|
||||
list_del(&master->list);
|
||||
mutex_unlock(&board_lock);
|
||||
diff --git a/drivers/staging/comedi/drivers/vmk80xx.c b/drivers/staging/comedi/drivers/vmk80xx.c
|
||||
index 95e53cfd76a41..51f9a7800edf5 100644
|
||||
--- a/drivers/staging/comedi/drivers/vmk80xx.c
|
||||
+++ b/drivers/staging/comedi/drivers/vmk80xx.c
|
||||
@@ -676,6 +676,9 @@ static int vmk80xx_find_usb_endpoints(struct comedi_device *dev)
|
||||
if (!devpriv->ep_rx || !devpriv->ep_tx)
|
||||
return -ENODEV;
|
||||
|
||||
+ if (!usb_endpoint_maxp(devpriv->ep_rx) || !usb_endpoint_maxp(devpriv->ep_tx))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
|
||||
index 25e76d4c15054..5b42b8d760cb4 100644
|
||||
--- a/drivers/usb/serial/ftdi_sio.c
|
||||
+++ b/drivers/usb/serial/ftdi_sio.c
|
||||
@@ -1032,6 +1032,11 @@ static const struct usb_device_id id_table_combined[] = {
|
||||
/* U-Blox devices */
|
||||
{ USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ZED_PID) },
|
||||
{ USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ODIN_PID) },
|
||||
+ /* FreeCalypso USB adapters */
|
||||
+ { USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_BUF_PID),
|
||||
+ .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
|
||||
+ { USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_UNBUF_PID),
|
||||
+ .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
|
||||
{ } /* Terminating entry */
|
||||
};
|
||||
|
||||
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
|
||||
index c33e06752b5f0..f3302516a1e4f 100644
|
||||
--- a/drivers/usb/serial/ftdi_sio_ids.h
|
||||
+++ b/drivers/usb/serial/ftdi_sio_ids.h
|
||||
@@ -38,6 +38,13 @@
|
||||
|
||||
#define FTDI_LUMEL_PD12_PID 0x6002
|
||||
|
||||
+/*
|
||||
+ * Custom USB adapters made by Falconia Partners LLC
|
||||
+ * for FreeCalypso project, ID codes allocated to Falconia by FTDI.
|
||||
+ */
|
||||
+#define FTDI_FALCONIA_JTAG_BUF_PID 0x7150
|
||||
+#define FTDI_FALCONIA_JTAG_UNBUF_PID 0x7151
|
||||
+
|
||||
/* Sienna Serial Interface by Secyourit GmbH */
|
||||
#define FTDI_SIENNA_PID 0x8348
|
||||
|
||||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
|
||||
index 8cff50ef4fd14..5017d37afe392 100644
|
||||
--- a/drivers/usb/serial/option.c
|
||||
+++ b/drivers/usb/serial/option.c
|
||||
@@ -529,6 +529,7 @@ static void option_instat_callback(struct urb *urb);
|
||||
/* Cellient products */
|
||||
#define CELLIENT_VENDOR_ID 0x2692
|
||||
#define CELLIENT_PRODUCT_MEN200 0x9005
|
||||
+#define CELLIENT_PRODUCT_MPL200 0x9025
|
||||
|
||||
/* Hyundai Petatel Inc. products */
|
||||
#define PETATEL_VENDOR_ID 0x1ff4
|
||||
@@ -1171,6 +1172,8 @@ static const struct usb_device_id option_ids[] = {
|
||||
.driver_info = NCTRL(2) | RSVD(3) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1053, 0xff), /* Telit FN980 (ECM) */
|
||||
.driver_info = NCTRL(0) | RSVD(1) },
|
||||
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1054, 0xff), /* Telit FT980-KS */
|
||||
+ .driver_info = NCTRL(2) | RSVD(3) },
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
|
||||
.driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
|
||||
@@ -1967,6 +1970,8 @@ static const struct usb_device_id option_ids[] = {
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) },
|
||||
{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
|
||||
+ { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MPL200),
|
||||
+ .driver_info = RSVD(1) | RSVD(4) },
|
||||
{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) },
|
||||
{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600E) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, TPLINK_PRODUCT_LTE, 0xff, 0x00, 0x00) }, /* TP-Link LTE Module */
|
||||
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
|
||||
index 4fcded2971d1d..bf5533d6d83bd 100644
|
||||
--- a/drivers/usb/serial/pl2303.c
|
||||
+++ b/drivers/usb/serial/pl2303.c
|
||||
@@ -89,6 +89,7 @@ static const struct usb_device_id id_table[] = {
|
||||
{ USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) },
|
||||
{ USB_DEVICE(HP_VENDOR_ID, HP_LD220TA_PRODUCT_ID) },
|
||||
{ USB_DEVICE(HP_VENDOR_ID, HP_LD381_PRODUCT_ID) },
|
||||
+ { USB_DEVICE(HP_VENDOR_ID, HP_LD381GC_PRODUCT_ID) },
|
||||
{ USB_DEVICE(HP_VENDOR_ID, HP_LD960_PRODUCT_ID) },
|
||||
{ USB_DEVICE(HP_VENDOR_ID, HP_LD960TA_PRODUCT_ID) },
|
||||
{ USB_DEVICE(HP_VENDOR_ID, HP_LCM220_PRODUCT_ID) },
|
||||
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
|
||||
index 54d2fb974a418..9d27c076f477e 100644
|
||||
--- a/drivers/usb/serial/pl2303.h
|
||||
+++ b/drivers/usb/serial/pl2303.h
|
||||
@@ -125,6 +125,7 @@
|
||||
|
||||
/* Hewlett-Packard POS Pole Displays */
|
||||
#define HP_VENDOR_ID 0x03f0
|
||||
+#define HP_LD381GC_PRODUCT_ID 0x0183
|
||||
#define HP_LM920_PRODUCT_ID 0x026b
|
||||
#define HP_TD620_PRODUCT_ID 0x0956
|
||||
#define HP_LD960_PRODUCT_ID 0x0b39
|
||||
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
|
||||
index 60ba35087d126..cfb4691d92741 100644
|
||||
--- a/fs/reiserfs/inode.c
|
||||
+++ b/fs/reiserfs/inode.c
|
||||
@@ -1553,11 +1553,7 @@ void reiserfs_read_locked_inode(struct inode *inode,
|
||||
* set version 1, version 2 could be used too, because stat data
|
||||
* key is the same in both versions
|
||||
*/
|
||||
- key.version = KEY_FORMAT_3_5;
|
||||
- key.on_disk_key.k_dir_id = dirino;
|
||||
- key.on_disk_key.k_objectid = inode->i_ino;
|
||||
- key.on_disk_key.k_offset = 0;
|
||||
- key.on_disk_key.k_type = 0;
|
||||
+ _make_cpu_key(&key, KEY_FORMAT_3_5, dirino, inode->i_ino, 0, 0, 3);
|
||||
|
||||
/* look for the object's stat data */
|
||||
retval = search_item(inode->i_sb, &key, &path_to_sd);
|
||||
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
|
||||
index d424b3d4bf3b4..92d39cbc2d64d 100644
|
||||
--- a/fs/reiserfs/xattr.c
|
||||
+++ b/fs/reiserfs/xattr.c
|
||||
@@ -656,6 +656,13 @@ reiserfs_xattr_get(struct inode *inode, const char *name, void *buffer,
|
||||
if (get_inode_sd_version(inode) == STAT_DATA_V1)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
+ /*
|
||||
+ * priv_root needn't be initialized during mount so allow initial
|
||||
+ * lookups to succeed.
|
||||
+ */
|
||||
+ if (!REISERFS_SB(inode->i_sb)->priv_root)
|
||||
+ return 0;
|
||||
+
|
||||
dentry = xattr_lookup(inode, name, XATTR_REPLACE);
|
||||
if (IS_ERR(dentry)) {
|
||||
err = PTR_ERR(dentry);
|
||||
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
|
||||
index 7c0c83dfe86e3..5aaf6cdb121a1 100644
|
||||
--- a/include/net/bluetooth/hci_core.h
|
||||
+++ b/include/net/bluetooth/hci_core.h
|
||||
@@ -1235,16 +1235,34 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
|
||||
conn->security_cfm_cb(conn, status);
|
||||
}
|
||||
|
||||
-static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
|
||||
- __u8 encrypt)
|
||||
+static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status)
|
||||
{
|
||||
struct hci_cb *cb;
|
||||
+ __u8 encrypt;
|
||||
+
|
||||
+ if (conn->state == BT_CONFIG) {
|
||||
+ if (!status)
|
||||
+ conn->state = BT_CONNECTED;
|
||||
|
||||
- if (conn->sec_level == BT_SECURITY_SDP)
|
||||
- conn->sec_level = BT_SECURITY_LOW;
|
||||
+ hci_connect_cfm(conn, status);
|
||||
+ hci_conn_drop(conn);
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
- if (conn->pending_sec_level > conn->sec_level)
|
||||
- conn->sec_level = conn->pending_sec_level;
|
||||
+ if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags))
|
||||
+ encrypt = 0x00;
|
||||
+ else if (test_bit(HCI_CONN_AES_CCM, &conn->flags))
|
||||
+ encrypt = 0x02;
|
||||
+ else
|
||||
+ encrypt = 0x01;
|
||||
+
|
||||
+ if (!status) {
|
||||
+ if (conn->sec_level == BT_SECURITY_SDP)
|
||||
+ conn->sec_level = BT_SECURITY_LOW;
|
||||
+
|
||||
+ if (conn->pending_sec_level > conn->sec_level)
|
||||
+ conn->sec_level = conn->pending_sec_level;
|
||||
+ }
|
||||
|
||||
mutex_lock(&hci_cb_list_lock);
|
||||
list_for_each_entry(cb, &hci_cb_list, list) {
|
||||
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c
|
||||
index 5f123c3320a7b..8f918155685db 100644
|
||||
--- a/net/bluetooth/a2mp.c
|
||||
+++ b/net/bluetooth/a2mp.c
|
||||
@@ -233,6 +233,9 @@ static int a2mp_discover_rsp(struct amp_mgr *mgr, struct sk_buff *skb,
|
||||
struct a2mp_info_req req;
|
||||
|
||||
found = true;
|
||||
+
|
||||
+ memset(&req, 0, sizeof(req));
|
||||
+
|
||||
req.id = cl->id;
|
||||
a2mp_send(mgr, A2MP_GETINFO_REQ, __next_ident(mgr),
|
||||
sizeof(req), &req);
|
||||
@@ -312,6 +315,8 @@ static int a2mp_getinfo_req(struct amp_mgr *mgr, struct sk_buff *skb,
|
||||
if (!hdev || hdev->dev_type != HCI_AMP) {
|
||||
struct a2mp_info_rsp rsp;
|
||||
|
||||
+ memset(&rsp, 0, sizeof(rsp));
|
||||
+
|
||||
rsp.id = req->id;
|
||||
rsp.status = A2MP_STATUS_INVALID_CTRL_ID;
|
||||
|
||||
@@ -355,6 +360,8 @@ static int a2mp_getinfo_rsp(struct amp_mgr *mgr, struct sk_buff *skb,
|
||||
if (!ctrl)
|
||||
return -ENOMEM;
|
||||
|
||||
+ memset(&req, 0, sizeof(req));
|
||||
+
|
||||
req.id = rsp->id;
|
||||
a2mp_send(mgr, A2MP_GETAMPASSOC_REQ, __next_ident(mgr), sizeof(req),
|
||||
&req);
|
||||
@@ -383,6 +390,8 @@ static int a2mp_getampassoc_req(struct amp_mgr *mgr, struct sk_buff *skb,
|
||||
struct a2mp_amp_assoc_rsp rsp;
|
||||
rsp.id = req->id;
|
||||
|
||||
+ memset(&rsp, 0, sizeof(rsp));
|
||||
+
|
||||
if (tmp) {
|
||||
rsp.status = A2MP_STATUS_COLLISION_OCCURED;
|
||||
amp_mgr_put(tmp);
|
||||
@@ -471,7 +480,6 @@ static int a2mp_createphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb,
|
||||
struct a2mp_cmd *hdr)
|
||||
{
|
||||
struct a2mp_physlink_req *req = (void *) skb->data;
|
||||
-
|
||||
struct a2mp_physlink_rsp rsp;
|
||||
struct hci_dev *hdev;
|
||||
struct hci_conn *hcon;
|
||||
@@ -482,6 +490,8 @@ static int a2mp_createphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb,
|
||||
|
||||
BT_DBG("local_id %d, remote_id %d", req->local_id, req->remote_id);
|
||||
|
||||
+ memset(&rsp, 0, sizeof(rsp));
|
||||
+
|
||||
rsp.local_id = req->remote_id;
|
||||
rsp.remote_id = req->local_id;
|
||||
|
||||
@@ -560,6 +570,8 @@ static int a2mp_discphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb,
|
||||
|
||||
BT_DBG("local_id %d remote_id %d", req->local_id, req->remote_id);
|
||||
|
||||
+ memset(&rsp, 0, sizeof(rsp));
|
||||
+
|
||||
rsp.local_id = req->remote_id;
|
||||
rsp.remote_id = req->local_id;
|
||||
rsp.status = A2MP_STATUS_SUCCESS;
|
||||
@@ -682,6 +694,8 @@ static int a2mp_chan_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb)
|
||||
if (err) {
|
||||
struct a2mp_cmd_rej rej;
|
||||
|
||||
+ memset(&rej, 0, sizeof(rej));
|
||||
+
|
||||
rej.reason = cpu_to_le16(0);
|
||||
hdr = (void *) skb->data;
|
||||
|
||||
@@ -905,6 +919,8 @@ void a2mp_send_getinfo_rsp(struct hci_dev *hdev)
|
||||
|
||||
BT_DBG("%s mgr %p", hdev->name, mgr);
|
||||
|
||||
+ memset(&rsp, 0, sizeof(rsp));
|
||||
+
|
||||
rsp.id = hdev->id;
|
||||
rsp.status = A2MP_STATUS_INVALID_CTRL_ID;
|
||||
|
||||
@@ -1002,6 +1018,8 @@ void a2mp_send_create_phy_link_rsp(struct hci_dev *hdev, u8 status)
|
||||
if (!mgr)
|
||||
return;
|
||||
|
||||
+ memset(&rsp, 0, sizeof(rsp));
|
||||
+
|
||||
hs_hcon = hci_conn_hash_lookup_state(hdev, AMP_LINK, BT_CONNECT);
|
||||
if (!hs_hcon) {
|
||||
rsp.status = A2MP_STATUS_UNABLE_START_LINK_CREATION;
|
||||
@@ -1034,6 +1052,8 @@ void a2mp_discover_amp(struct l2cap_chan *chan)
|
||||
|
||||
mgr->bredr_chan = chan;
|
||||
|
||||
+ memset(&req, 0, sizeof(req));
|
||||
+
|
||||
req.mtu = cpu_to_le16(L2CAP_A2MP_DEFAULT_MTU);
|
||||
req.ext_feat = 0;
|
||||
a2mp_send(mgr, A2MP_DISCOVER_REQ, 1, sizeof(req), &req);
|
||||
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
|
||||
index 114bcf6ea9168..2c94e3cd3545f 100644
|
||||
--- a/net/bluetooth/hci_conn.c
|
||||
+++ b/net/bluetooth/hci_conn.c
|
||||
@@ -1173,6 +1173,23 @@ int hci_conn_check_link_mode(struct hci_conn *conn)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ /* AES encryption is required for Level 4:
|
||||
+ *
|
||||
+ * BLUETOOTH CORE SPECIFICATION Version 5.2 | Vol 3, Part C
|
||||
+ * page 1319:
|
||||
+ *
|
||||
+ * 128-bit equivalent strength for link and encryption keys
|
||||
+ * required using FIPS approved algorithms (E0 not allowed,
|
||||
+ * SAFER+ not allowed, and P-192 not allowed; encryption key
|
||||
+ * not shortened)
|
||||
+ */
|
||||
+ if (conn->sec_level == BT_SECURITY_FIPS &&
|
||||
+ !test_bit(HCI_CONN_AES_CCM, &conn->flags)) {
|
||||
+ bt_dev_err(conn->hdev,
|
||||
+ "Invalid security: Missing AES-CCM usage");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
if (hci_conn_ssp_enabled(conn) &&
|
||||
!test_bit(HCI_CONN_ENCRYPT, &conn->flags))
|
||||
return 0;
|
||||
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
|
||||
index 03319ab8a7c6e..7cee89fddcd50 100644
|
||||
--- a/net/bluetooth/hci_event.c
|
||||
+++ b/net/bluetooth/hci_event.c
|
||||
@@ -1133,6 +1133,9 @@ static void store_pending_adv_report(struct hci_dev *hdev, bdaddr_t *bdaddr,
|
||||
{
|
||||
struct discovery_state *d = &hdev->discovery;
|
||||
|
||||
+ if (len > HCI_MAX_AD_LENGTH)
|
||||
+ return;
|
||||
+
|
||||
bacpy(&d->last_adv_addr, bdaddr);
|
||||
d->last_adv_addr_type = bdaddr_type;
|
||||
d->last_adv_rssi = rssi;
|
||||
@@ -2479,7 +2482,7 @@ static void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
|
||||
&cp);
|
||||
} else {
|
||||
clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
|
||||
- hci_encrypt_cfm(conn, ev->status, 0x00);
|
||||
+ hci_encrypt_cfm(conn, ev->status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2565,22 +2568,7 @@ static void read_enc_key_size_complete(struct hci_dev *hdev, u8 status,
|
||||
conn->enc_key_size = rp->key_size;
|
||||
}
|
||||
|
||||
- if (conn->state == BT_CONFIG) {
|
||||
- conn->state = BT_CONNECTED;
|
||||
- hci_connect_cfm(conn, 0);
|
||||
- hci_conn_drop(conn);
|
||||
- } else {
|
||||
- u8 encrypt;
|
||||
-
|
||||
- if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags))
|
||||
- encrypt = 0x00;
|
||||
- else if (test_bit(HCI_CONN_AES_CCM, &conn->flags))
|
||||
- encrypt = 0x02;
|
||||
- else
|
||||
- encrypt = 0x01;
|
||||
-
|
||||
- hci_encrypt_cfm(conn, 0, encrypt);
|
||||
- }
|
||||
+ hci_encrypt_cfm(conn, 0);
|
||||
|
||||
unlock:
|
||||
hci_dev_unlock(hdev);
|
||||
@@ -2627,24 +2615,20 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *skb)
|
||||
|
||||
clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
|
||||
|
||||
+ /* Check link security requirements are met */
|
||||
+ if (!hci_conn_check_link_mode(conn))
|
||||
+ ev->status = HCI_ERROR_AUTH_FAILURE;
|
||||
+
|
||||
if (ev->status && conn->state == BT_CONNECTED) {
|
||||
+ /* Notify upper layers so they can cleanup before
|
||||
+ * disconnecting.
|
||||
+ */
|
||||
+ hci_encrypt_cfm(conn, ev->status);
|
||||
hci_disconnect(conn, HCI_ERROR_AUTH_FAILURE);
|
||||
hci_conn_drop(conn);
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
- /* In Secure Connections Only mode, do not allow any connections
|
||||
- * that are not encrypted with AES-CCM using a P-256 authenticated
|
||||
- * combination key.
|
||||
- */
|
||||
- if (hci_dev_test_flag(hdev, HCI_SC_ONLY) &&
|
||||
- (!test_bit(HCI_CONN_AES_CCM, &conn->flags) ||
|
||||
- conn->key_type != HCI_LK_AUTH_COMBINATION_P256)) {
|
||||
- hci_connect_cfm(conn, HCI_ERROR_AUTH_FAILURE);
|
||||
- hci_conn_drop(conn);
|
||||
- goto unlock;
|
||||
- }
|
||||
-
|
||||
/* Try reading the encryption key size for encrypted ACL links */
|
||||
if (!ev->status && ev->encrypt && conn->type == ACL_LINK) {
|
||||
struct hci_cp_read_enc_key_size cp;
|
||||
@@ -2674,14 +2658,7 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *skb)
|
||||
}
|
||||
|
||||
notify:
|
||||
- if (conn->state == BT_CONFIG) {
|
||||
- if (!ev->status)
|
||||
- conn->state = BT_CONNECTED;
|
||||
-
|
||||
- hci_connect_cfm(conn, ev->status);
|
||||
- hci_conn_drop(conn);
|
||||
- } else
|
||||
- hci_encrypt_cfm(conn, ev->status, ev->encrypt);
|
||||
+ hci_encrypt_cfm(conn, ev->status);
|
||||
|
||||
unlock:
|
||||
hci_dev_unlock(hdev);
|
||||
@@ -4752,6 +4729,11 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
|
||||
u32 flags;
|
||||
u8 *ptr, real_len;
|
||||
|
||||
+ if (len > HCI_MAX_AD_LENGTH) {
|
||||
+ pr_err_ratelimited("legacy adv larger than 31 bytes");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
/* Find the end of the data in case the report contains padded zero
|
||||
* bytes at the end causing an invalid length value.
|
||||
*
|
||||
@@ -4812,7 +4794,7 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
|
||||
*/
|
||||
conn = check_pending_le_conn(hdev, bdaddr, bdaddr_type, type,
|
||||
direct_addr);
|
||||
- if (conn && type == LE_ADV_IND) {
|
||||
+ if (conn && type == LE_ADV_IND && len <= HCI_MAX_AD_LENGTH) {
|
||||
/* Store report for later inclusion by
|
||||
* mgmt_device_connected
|
||||
*/
|
||||
@@ -4937,10 +4919,14 @@ static void hci_le_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb)
|
||||
struct hci_ev_le_advertising_info *ev = ptr;
|
||||
s8 rssi;
|
||||
|
||||
- rssi = ev->data[ev->length];
|
||||
- process_adv_report(hdev, ev->evt_type, &ev->bdaddr,
|
||||
- ev->bdaddr_type, NULL, 0, rssi,
|
||||
- ev->data, ev->length);
|
||||
+ if (ev->length <= HCI_MAX_AD_LENGTH) {
|
||||
+ rssi = ev->data[ev->length];
|
||||
+ process_adv_report(hdev, ev->evt_type, &ev->bdaddr,
|
||||
+ ev->bdaddr_type, NULL, 0, rssi,
|
||||
+ ev->data, ev->length);
|
||||
+ } else {
|
||||
+ bt_dev_err(hdev, "Dropping invalid advertising data");
|
||||
+ }
|
||||
|
||||
ptr += sizeof(*ev) + ev->length + 1;
|
||||
}
|
||||
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
|
||||
index ecc3da6a14a18..ee761fb095594 100644
|
||||
--- a/net/bluetooth/mgmt.c
|
||||
+++ b/net/bluetooth/mgmt.c
|
||||
@@ -628,7 +628,8 @@ static u32 get_supported_settings(struct hci_dev *hdev)
|
||||
|
||||
if (lmp_ssp_capable(hdev)) {
|
||||
settings |= MGMT_SETTING_SSP;
|
||||
- settings |= MGMT_SETTING_HS;
|
||||
+ if (IS_ENABLED(CONFIG_BT_HS))
|
||||
+ settings |= MGMT_SETTING_HS;
|
||||
}
|
||||
|
||||
if (lmp_sc_capable(hdev))
|
||||
@@ -2281,6 +2282,10 @@ static int set_link_security(struct sock *sk, struct hci_dev *hdev, void *data,
|
||||
|
||||
BT_DBG("request for %s", hdev->name);
|
||||
|
||||
+ if (!IS_ENABLED(CONFIG_BT_HS))
|
||||
+ return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS,
|
||||
+ MGMT_STATUS_NOT_SUPPORTED);
|
||||
+
|
||||
status = mgmt_bredr_support(hdev);
|
||||
if (status)
|
||||
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_LINK_SECURITY,
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,28 +0,0 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 0ba3fd9144264..99badda272d74 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,6 +1,6 @@
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 4
|
||||
-SUBLEVEL = 242
|
||||
+SUBLEVEL = 243
|
||||
EXTRAVERSION =
|
||||
NAME = Blurry Fish Butt
|
||||
|
||||
diff --git a/drivers/powercap/powercap_sys.c b/drivers/powercap/powercap_sys.c
|
||||
index fd12ccc11e262..2313bb93f5c2e 100644
|
||||
--- a/drivers/powercap/powercap_sys.c
|
||||
+++ b/drivers/powercap/powercap_sys.c
|
||||
@@ -379,9 +379,9 @@ static void create_power_zone_common_attributes(
|
||||
&dev_attr_max_energy_range_uj.attr;
|
||||
if (power_zone->ops->get_energy_uj) {
|
||||
if (power_zone->ops->reset_energy_uj)
|
||||
- dev_attr_energy_uj.attr.mode = S_IWUSR | S_IRUGO;
|
||||
+ dev_attr_energy_uj.attr.mode = S_IWUSR | S_IRUSR;
|
||||
else
|
||||
- dev_attr_energy_uj.attr.mode = S_IRUGO;
|
||||
+ dev_attr_energy_uj.attr.mode = S_IRUSR;
|
||||
power_zone->zone_dev_attrs[count++] =
|
||||
&dev_attr_energy_uj.attr;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,814 +0,0 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index c42ada4e88466..c493d3ae046f6 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,6 +1,6 @@
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 4
|
||||
-SUBLEVEL = 246
|
||||
+SUBLEVEL = 247
|
||||
EXTRAVERSION =
|
||||
NAME = Blurry Fish Butt
|
||||
|
||||
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
|
||||
index 2c9a2992863b0..ffc3bc8111b80 100644
|
||||
--- a/arch/x86/kernel/cpu/bugs.c
|
||||
+++ b/arch/x86/kernel/cpu/bugs.c
|
||||
@@ -707,11 +707,13 @@ spectre_v2_user_select_mitigation(enum spectre_v2_mitigation_cmd v2_cmd)
|
||||
if (boot_cpu_has(X86_FEATURE_IBPB)) {
|
||||
setup_force_cpu_cap(X86_FEATURE_USE_IBPB);
|
||||
|
||||
+ spectre_v2_user_ibpb = mode;
|
||||
switch (cmd) {
|
||||
case SPECTRE_V2_USER_CMD_FORCE:
|
||||
case SPECTRE_V2_USER_CMD_PRCTL_IBPB:
|
||||
case SPECTRE_V2_USER_CMD_SECCOMP_IBPB:
|
||||
static_branch_enable(&switch_mm_always_ibpb);
|
||||
+ spectre_v2_user_ibpb = SPECTRE_V2_USER_STRICT;
|
||||
break;
|
||||
case SPECTRE_V2_USER_CMD_PRCTL:
|
||||
case SPECTRE_V2_USER_CMD_AUTO:
|
||||
@@ -725,8 +727,6 @@ spectre_v2_user_select_mitigation(enum spectre_v2_mitigation_cmd v2_cmd)
|
||||
pr_info("mitigation: Enabling %s Indirect Branch Prediction Barrier\n",
|
||||
static_key_enabled(&switch_mm_always_ibpb) ?
|
||||
"always-on" : "conditional");
|
||||
-
|
||||
- spectre_v2_user_ibpb = mode;
|
||||
}
|
||||
|
||||
/*
|
||||
diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c
|
||||
index 85872a08994a1..e9fc0f7df0da8 100644
|
||||
--- a/arch/x86/xen/spinlock.c
|
||||
+++ b/arch/x86/xen/spinlock.c
|
||||
@@ -301,10 +301,20 @@ void xen_init_lock_cpu(int cpu)
|
||||
|
||||
void xen_uninit_lock_cpu(int cpu)
|
||||
{
|
||||
+ int irq;
|
||||
+
|
||||
if (!xen_pvspin)
|
||||
return;
|
||||
|
||||
- unbind_from_irqhandler(per_cpu(lock_kicker_irq, cpu), NULL);
|
||||
+ /*
|
||||
+ * When booting the kernel with 'mitigations=auto,nosmt', the secondary
|
||||
+ * CPUs are not activated, and lock_kicker_irq is not initialized.
|
||||
+ */
|
||||
+ irq = per_cpu(lock_kicker_irq, cpu);
|
||||
+ if (irq == -1)
|
||||
+ return;
|
||||
+
|
||||
+ unbind_from_irqhandler(irq, NULL);
|
||||
per_cpu(lock_kicker_irq, cpu) = -1;
|
||||
kfree(per_cpu(irq_name, cpu));
|
||||
per_cpu(irq_name, cpu) = NULL;
|
||||
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
|
||||
index 9aa57b37381a9..7f66ae1945b24 100644
|
||||
--- a/drivers/dma/pl330.c
|
||||
+++ b/drivers/dma/pl330.c
|
||||
@@ -2634,7 +2634,7 @@ pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst,
|
||||
* If burst size is smaller than bus width then make sure we only
|
||||
* transfer one at a time to avoid a burst stradling an MFIFO entry.
|
||||
*/
|
||||
- if (desc->rqcfg.brst_size * 8 < pl330->pcfg.data_bus_width)
|
||||
+ if (burst * 8 < pl330->pcfg.data_bus_width)
|
||||
desc->rqcfg.brst_len = 1;
|
||||
|
||||
desc->bytes_requested = len;
|
||||
diff --git a/drivers/hid/hid-cypress.c b/drivers/hid/hid-cypress.c
|
||||
index 1689568b597d4..12c5d7c96527a 100644
|
||||
--- a/drivers/hid/hid-cypress.c
|
||||
+++ b/drivers/hid/hid-cypress.c
|
||||
@@ -26,19 +26,17 @@
|
||||
#define CP_2WHEEL_MOUSE_HACK 0x02
|
||||
#define CP_2WHEEL_MOUSE_HACK_ON 0x04
|
||||
|
||||
+#define VA_INVAL_LOGICAL_BOUNDARY 0x08
|
||||
+
|
||||
/*
|
||||
* Some USB barcode readers from cypress have usage min and usage max in
|
||||
* the wrong order
|
||||
*/
|
||||
-static __u8 *cp_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
||||
+static __u8 *cp_rdesc_fixup(struct hid_device *hdev, __u8 *rdesc,
|
||||
unsigned int *rsize)
|
||||
{
|
||||
- unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);
|
||||
unsigned int i;
|
||||
|
||||
- if (!(quirks & CP_RDESC_SWAPPED_MIN_MAX))
|
||||
- return rdesc;
|
||||
-
|
||||
if (*rsize < 4)
|
||||
return rdesc;
|
||||
|
||||
@@ -51,6 +49,40 @@ static __u8 *cp_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
||||
return rdesc;
|
||||
}
|
||||
|
||||
+static __u8 *va_logical_boundary_fixup(struct hid_device *hdev, __u8 *rdesc,
|
||||
+ unsigned int *rsize)
|
||||
+{
|
||||
+ /*
|
||||
+ * Varmilo VA104M (with VID Cypress and device ID 07B1) incorrectly
|
||||
+ * reports Logical Minimum of its Consumer Control device as 572
|
||||
+ * (0x02 0x3c). Fix this by setting its Logical Minimum to zero.
|
||||
+ */
|
||||
+ if (*rsize == 25 &&
|
||||
+ rdesc[0] == 0x05 && rdesc[1] == 0x0c &&
|
||||
+ rdesc[2] == 0x09 && rdesc[3] == 0x01 &&
|
||||
+ rdesc[6] == 0x19 && rdesc[7] == 0x00 &&
|
||||
+ rdesc[11] == 0x16 && rdesc[12] == 0x3c && rdesc[13] == 0x02) {
|
||||
+ hid_info(hdev,
|
||||
+ "fixing up varmilo VA104M consumer control report descriptor\n");
|
||||
+ rdesc[12] = 0x00;
|
||||
+ rdesc[13] = 0x00;
|
||||
+ }
|
||||
+ return rdesc;
|
||||
+}
|
||||
+
|
||||
+static __u8 *cp_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
||||
+ unsigned int *rsize)
|
||||
+{
|
||||
+ unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);
|
||||
+
|
||||
+ if (quirks & CP_RDESC_SWAPPED_MIN_MAX)
|
||||
+ rdesc = cp_rdesc_fixup(hdev, rdesc, rsize);
|
||||
+ if (quirks & VA_INVAL_LOGICAL_BOUNDARY)
|
||||
+ rdesc = va_logical_boundary_fixup(hdev, rdesc, rsize);
|
||||
+
|
||||
+ return rdesc;
|
||||
+}
|
||||
+
|
||||
static int cp_input_mapped(struct hid_device *hdev, struct hid_input *hi,
|
||||
struct hid_field *field, struct hid_usage *usage,
|
||||
unsigned long **bit, int *max)
|
||||
@@ -131,6 +163,8 @@ static const struct hid_device_id cp_devices[] = {
|
||||
.driver_data = CP_RDESC_SWAPPED_MIN_MAX },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE),
|
||||
.driver_data = CP_2WHEEL_MOUSE_HACK },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_VARMILO_VA104M_07B1),
|
||||
+ .driver_data = VA_INVAL_LOGICAL_BOUNDARY },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(hid, cp_devices);
|
||||
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
|
||||
index 33d2b5948d7fc..773452c6edfab 100644
|
||||
--- a/drivers/hid/hid-ids.h
|
||||
+++ b/drivers/hid/hid-ids.h
|
||||
@@ -279,6 +279,8 @@
|
||||
#define USB_DEVICE_ID_CYPRESS_BARCODE_4 0xed81
|
||||
#define USB_DEVICE_ID_CYPRESS_TRUETOUCH 0xc001
|
||||
|
||||
+#define USB_DEVICE_ID_CYPRESS_VARMILO_VA104M_07B1 0X07b1
|
||||
+
|
||||
#define USB_VENDOR_ID_DATA_MODUL 0x7374
|
||||
#define USB_VENDOR_ID_DATA_MODUL_EASYMAXTOUCH 0x1201
|
||||
|
||||
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
|
||||
index 8efaa88329aa3..83e45d5801a98 100644
|
||||
--- a/drivers/hid/hid-sensor-hub.c
|
||||
+++ b/drivers/hid/hid-sensor-hub.c
|
||||
@@ -473,7 +473,8 @@ static int sensor_hub_raw_event(struct hid_device *hdev,
|
||||
return 1;
|
||||
|
||||
ptr = raw_data;
|
||||
- ptr++; /* Skip report id */
|
||||
+ if (report->id)
|
||||
+ ptr++; /* Skip report id */
|
||||
|
||||
spin_lock_irqsave(&pdata->lock, flags);
|
||||
|
||||
diff --git a/drivers/infiniband/hw/mthca/mthca_cq.c b/drivers/infiniband/hw/mthca/mthca_cq.c
|
||||
index 40ba833381557..59e1f6ea2ede9 100644
|
||||
--- a/drivers/infiniband/hw/mthca/mthca_cq.c
|
||||
+++ b/drivers/infiniband/hw/mthca/mthca_cq.c
|
||||
@@ -811,8 +811,10 @@ int mthca_init_cq(struct mthca_dev *dev, int nent,
|
||||
}
|
||||
|
||||
mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL);
|
||||
- if (IS_ERR(mailbox))
|
||||
+ if (IS_ERR(mailbox)) {
|
||||
+ err = PTR_ERR(mailbox);
|
||||
goto err_out_arm;
|
||||
+ }
|
||||
|
||||
cq_context = mailbox->buf;
|
||||
|
||||
@@ -854,9 +856,9 @@ int mthca_init_cq(struct mthca_dev *dev, int nent,
|
||||
}
|
||||
|
||||
spin_lock_irq(&dev->cq_table.lock);
|
||||
- if (mthca_array_set(&dev->cq_table.cq,
|
||||
- cq->cqn & (dev->limits.num_cqs - 1),
|
||||
- cq)) {
|
||||
+ err = mthca_array_set(&dev->cq_table.cq,
|
||||
+ cq->cqn & (dev->limits.num_cqs - 1), cq);
|
||||
+ if (err) {
|
||||
spin_unlock_irq(&dev->cq_table.lock);
|
||||
goto err_out_free_mr;
|
||||
}
|
||||
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
|
||||
index c84c685056b99..6b648339733fa 100644
|
||||
--- a/drivers/input/serio/i8042.c
|
||||
+++ b/drivers/input/serio/i8042.c
|
||||
@@ -125,6 +125,7 @@ module_param_named(unmask_kbd_data, i8042_unmask_kbd_data, bool, 0600);
|
||||
MODULE_PARM_DESC(unmask_kbd_data, "Unconditional enable (may reveal sensitive data) of normally sanitize-filtered kbd data traffic debug log [pre-condition: i8042.debug=1 enabled]");
|
||||
#endif
|
||||
|
||||
+static bool i8042_present;
|
||||
static bool i8042_bypass_aux_irq_test;
|
||||
static char i8042_kbd_firmware_id[128];
|
||||
static char i8042_aux_firmware_id[128];
|
||||
@@ -343,6 +344,9 @@ int i8042_command(unsigned char *param, int command)
|
||||
unsigned long flags;
|
||||
int retval;
|
||||
|
||||
+ if (!i8042_present)
|
||||
+ return -1;
|
||||
+
|
||||
spin_lock_irqsave(&i8042_lock, flags);
|
||||
retval = __i8042_command(param, command);
|
||||
spin_unlock_irqrestore(&i8042_lock, flags);
|
||||
@@ -1597,12 +1601,15 @@ static int __init i8042_init(void)
|
||||
|
||||
err = i8042_platform_init();
|
||||
if (err)
|
||||
- return err;
|
||||
+ return (err == -ENODEV) ? 0 : err;
|
||||
|
||||
err = i8042_controller_check();
|
||||
if (err)
|
||||
goto err_platform_exit;
|
||||
|
||||
+ /* Set this before creating the dev to allow i8042_command to work right away */
|
||||
+ i8042_present = true;
|
||||
+
|
||||
pdev = platform_create_bundle(&i8042_driver, i8042_probe, NULL, 0, NULL, 0);
|
||||
if (IS_ERR(pdev)) {
|
||||
err = PTR_ERR(pdev);
|
||||
@@ -1621,6 +1628,9 @@ static int __init i8042_init(void)
|
||||
|
||||
static void __exit i8042_exit(void)
|
||||
{
|
||||
+ if (!i8042_present)
|
||||
+ return;
|
||||
+
|
||||
platform_device_unregister(i8042_platform_device);
|
||||
platform_driver_unregister(&i8042_driver);
|
||||
i8042_platform_exit();
|
||||
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
|
||||
index 2da1c22946450..250ecbcca019f 100644
|
||||
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
|
||||
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
|
||||
@@ -5198,7 +5198,8 @@ static int bnxt_init_board(struct pci_dev *pdev, struct net_device *dev)
|
||||
if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) != 0 &&
|
||||
dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)) != 0) {
|
||||
dev_err(&pdev->dev, "System does not support DMA, aborting\n");
|
||||
- goto init_err_disable;
|
||||
+ rc = -EIO;
|
||||
+ goto init_err_release;
|
||||
}
|
||||
|
||||
pci_set_master(pdev);
|
||||
diff --git a/drivers/nfc/s3fwrn5/i2c.c b/drivers/nfc/s3fwrn5/i2c.c
|
||||
index c61d8a308da45..779f7a76ecd3d 100644
|
||||
--- a/drivers/nfc/s3fwrn5/i2c.c
|
||||
+++ b/drivers/nfc/s3fwrn5/i2c.c
|
||||
@@ -37,8 +37,8 @@ struct s3fwrn5_i2c_phy {
|
||||
struct i2c_client *i2c_dev;
|
||||
struct nci_dev *ndev;
|
||||
|
||||
- unsigned int gpio_en;
|
||||
- unsigned int gpio_fw_wake;
|
||||
+ int gpio_en;
|
||||
+ int gpio_fw_wake;
|
||||
|
||||
struct mutex mutex;
|
||||
|
||||
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
|
||||
index b4fbcf4cade8f..36e415487fe53 100644
|
||||
--- a/drivers/scsi/libiscsi.c
|
||||
+++ b/drivers/scsi/libiscsi.c
|
||||
@@ -570,8 +570,8 @@ static void iscsi_complete_task(struct iscsi_task *task, int state)
|
||||
if (conn->task == task)
|
||||
conn->task = NULL;
|
||||
|
||||
- if (conn->ping_task == task)
|
||||
- conn->ping_task = NULL;
|
||||
+ if (READ_ONCE(conn->ping_task) == task)
|
||||
+ WRITE_ONCE(conn->ping_task, NULL);
|
||||
|
||||
/* release get from queueing */
|
||||
__iscsi_put_task(task);
|
||||
@@ -780,6 +780,9 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
||||
task->conn->session->age);
|
||||
}
|
||||
|
||||
+ if (unlikely(READ_ONCE(conn->ping_task) == INVALID_SCSI_TASK))
|
||||
+ WRITE_ONCE(conn->ping_task, task);
|
||||
+
|
||||
if (!ihost->workq) {
|
||||
if (iscsi_prep_mgmt_task(conn, task))
|
||||
goto free_task;
|
||||
@@ -987,8 +990,11 @@ static int iscsi_send_nopout(struct iscsi_conn *conn, struct iscsi_nopin *rhdr)
|
||||
struct iscsi_nopout hdr;
|
||||
struct iscsi_task *task;
|
||||
|
||||
- if (!rhdr && conn->ping_task)
|
||||
- return -EINVAL;
|
||||
+ if (!rhdr) {
|
||||
+ if (READ_ONCE(conn->ping_task))
|
||||
+ return -EINVAL;
|
||||
+ WRITE_ONCE(conn->ping_task, INVALID_SCSI_TASK);
|
||||
+ }
|
||||
|
||||
memset(&hdr, 0, sizeof(struct iscsi_nopout));
|
||||
hdr.opcode = ISCSI_OP_NOOP_OUT | ISCSI_OP_IMMEDIATE;
|
||||
@@ -1003,11 +1009,12 @@ static int iscsi_send_nopout(struct iscsi_conn *conn, struct iscsi_nopin *rhdr)
|
||||
|
||||
task = __iscsi_conn_send_pdu(conn, (struct iscsi_hdr *)&hdr, NULL, 0);
|
||||
if (!task) {
|
||||
+ if (!rhdr)
|
||||
+ WRITE_ONCE(conn->ping_task, NULL);
|
||||
iscsi_conn_printk(KERN_ERR, conn, "Could not send nopout\n");
|
||||
return -EIO;
|
||||
} else if (!rhdr) {
|
||||
/* only track our nops */
|
||||
- conn->ping_task = task;
|
||||
conn->last_ping = jiffies;
|
||||
}
|
||||
|
||||
@@ -1020,7 +1027,7 @@ static int iscsi_nop_out_rsp(struct iscsi_task *task,
|
||||
struct iscsi_conn *conn = task->conn;
|
||||
int rc = 0;
|
||||
|
||||
- if (conn->ping_task != task) {
|
||||
+ if (READ_ONCE(conn->ping_task) != task) {
|
||||
/*
|
||||
* If this is not in response to one of our
|
||||
* nops then it must be from userspace.
|
||||
@@ -1960,7 +1967,7 @@ static void iscsi_start_tx(struct iscsi_conn *conn)
|
||||
*/
|
||||
static int iscsi_has_ping_timed_out(struct iscsi_conn *conn)
|
||||
{
|
||||
- if (conn->ping_task &&
|
||||
+ if (READ_ONCE(conn->ping_task) &&
|
||||
time_before_eq(conn->last_recv + (conn->recv_timeout * HZ) +
|
||||
(conn->ping_timeout * HZ), jiffies))
|
||||
return 1;
|
||||
@@ -2095,7 +2102,7 @@ static enum blk_eh_timer_return iscsi_eh_cmd_timed_out(struct scsi_cmnd *sc)
|
||||
* Checking the transport already or nop from a cmd timeout still
|
||||
* running
|
||||
*/
|
||||
- if (conn->ping_task) {
|
||||
+ if (READ_ONCE(conn->ping_task)) {
|
||||
task->have_checked_conn = true;
|
||||
rc = BLK_EH_RESET_TIMER;
|
||||
goto done;
|
||||
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
|
||||
index d7a0a64f64536..e37f6db0dd156 100644
|
||||
--- a/drivers/scsi/ufs/ufshcd.c
|
||||
+++ b/drivers/scsi/ufs/ufshcd.c
|
||||
@@ -5387,11 +5387,7 @@ int ufshcd_shutdown(struct ufs_hba *hba)
|
||||
if (ufshcd_is_ufs_dev_poweroff(hba) && ufshcd_is_link_off(hba))
|
||||
goto out;
|
||||
|
||||
- if (pm_runtime_suspended(hba->dev)) {
|
||||
- ret = ufshcd_runtime_resume(hba);
|
||||
- if (ret)
|
||||
- goto out;
|
||||
- }
|
||||
+ pm_runtime_get_sync(hba->dev);
|
||||
|
||||
ret = ufshcd_suspend(hba, UFS_SHUTDOWN_PM);
|
||||
out:
|
||||
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
|
||||
index cbb4414edd71b..c48aca1360c89 100644
|
||||
--- a/drivers/target/iscsi/iscsi_target.c
|
||||
+++ b/drivers/target/iscsi/iscsi_target.c
|
||||
@@ -493,8 +493,7 @@ static void iscsit_aborted_task(struct iscsi_conn *conn, struct iscsi_cmd *cmd)
|
||||
bool scsi_cmd = (cmd->iscsi_opcode == ISCSI_OP_SCSI_CMD);
|
||||
|
||||
spin_lock_bh(&conn->cmd_lock);
|
||||
- if (!list_empty(&cmd->i_conn_node) &&
|
||||
- !(cmd->se_cmd.transport_state & CMD_T_FABRIC_STOP))
|
||||
+ if (!list_empty(&cmd->i_conn_node))
|
||||
list_del_init(&cmd->i_conn_node);
|
||||
spin_unlock_bh(&conn->cmd_lock);
|
||||
|
||||
@@ -4228,12 +4227,22 @@ static void iscsit_release_commands_from_conn(struct iscsi_conn *conn)
|
||||
spin_lock_bh(&conn->cmd_lock);
|
||||
list_splice_init(&conn->conn_cmd_list, &tmp_list);
|
||||
|
||||
- list_for_each_entry(cmd, &tmp_list, i_conn_node) {
|
||||
+ list_for_each_entry_safe(cmd, cmd_tmp, &tmp_list, i_conn_node) {
|
||||
struct se_cmd *se_cmd = &cmd->se_cmd;
|
||||
|
||||
if (se_cmd->se_tfo != NULL) {
|
||||
spin_lock_irq(&se_cmd->t_state_lock);
|
||||
- se_cmd->transport_state |= CMD_T_FABRIC_STOP;
|
||||
+ if (se_cmd->transport_state & CMD_T_ABORTED) {
|
||||
+ /*
|
||||
+ * LIO's abort path owns the cleanup for this,
|
||||
+ * so put it back on the list and let
|
||||
+ * aborted_task handle it.
|
||||
+ */
|
||||
+ list_move_tail(&cmd->i_conn_node,
|
||||
+ &conn->conn_cmd_list);
|
||||
+ } else {
|
||||
+ se_cmd->transport_state |= CMD_T_FABRIC_STOP;
|
||||
+ }
|
||||
spin_unlock_irq(&se_cmd->t_state_lock);
|
||||
}
|
||||
}
|
||||
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
|
||||
index 570a76d912503..eca8d04cfb3ec 100644
|
||||
--- a/drivers/usb/core/config.c
|
||||
+++ b/drivers/usb/core/config.c
|
||||
@@ -222,6 +222,7 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno,
|
||||
struct usb_host_interface *ifp, int num_ep,
|
||||
unsigned char *buffer, int size)
|
||||
{
|
||||
+ struct usb_device *udev = to_usb_device(ddev);
|
||||
unsigned char *buffer0 = buffer;
|
||||
struct usb_endpoint_descriptor *d;
|
||||
struct usb_host_endpoint *endpoint;
|
||||
@@ -263,6 +264,16 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno,
|
||||
goto skip_to_next_endpoint_or_interface_descriptor;
|
||||
}
|
||||
|
||||
+ /* Ignore blacklisted endpoints */
|
||||
+ if (udev->quirks & USB_QUIRK_ENDPOINT_BLACKLIST) {
|
||||
+ if (usb_endpoint_is_blacklisted(udev, ifp, d)) {
|
||||
+ dev_warn(ddev, "config %d interface %d altsetting %d has a blacklisted endpoint with address 0x%X, skipping\n",
|
||||
+ cfgno, inum, asnum,
|
||||
+ d->bEndpointAddress);
|
||||
+ goto skip_to_next_endpoint_or_interface_descriptor;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
endpoint = &ifp->endpoint[ifp->desc.bNumEndpoints];
|
||||
++ifp->desc.bNumEndpoints;
|
||||
|
||||
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
|
||||
index 7559d96695da6..4c1679cc57425 100644
|
||||
--- a/drivers/usb/core/devio.c
|
||||
+++ b/drivers/usb/core/devio.c
|
||||
@@ -369,11 +369,11 @@ static void snoop_urb(struct usb_device *udev,
|
||||
|
||||
if (userurb) { /* Async */
|
||||
if (when == SUBMIT)
|
||||
- dev_info(&udev->dev, "userurb %pK, ep%d %s-%s, "
|
||||
+ dev_info(&udev->dev, "userurb %px, ep%d %s-%s, "
|
||||
"length %u\n",
|
||||
userurb, ep, t, d, length);
|
||||
else
|
||||
- dev_info(&udev->dev, "userurb %pK, ep%d %s-%s, "
|
||||
+ dev_info(&udev->dev, "userurb %px, ep%d %s-%s, "
|
||||
"actual_length %u status %d\n",
|
||||
userurb, ep, t, d, length,
|
||||
timeout_or_status);
|
||||
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
|
||||
index ca74b67c4450d..34d8cece6dd3b 100644
|
||||
--- a/drivers/usb/core/quirks.c
|
||||
+++ b/drivers/usb/core/quirks.c
|
||||
@@ -195,6 +195,10 @@ static const struct usb_device_id usb_quirk_list[] = {
|
||||
/* Guillemot Webcam Hercules Dualpix Exchange*/
|
||||
{ USB_DEVICE(0x06f8, 0x3005), .driver_info = USB_QUIRK_RESET_RESUME },
|
||||
|
||||
+ /* Guillemot Hercules DJ Console audio card (BZ 208357) */
|
||||
+ { USB_DEVICE(0x06f8, 0xb000), .driver_info =
|
||||
+ USB_QUIRK_ENDPOINT_BLACKLIST },
|
||||
+
|
||||
/* Midiman M-Audio Keystation 88es */
|
||||
{ USB_DEVICE(0x0763, 0x0192), .driver_info = USB_QUIRK_RESET_RESUME },
|
||||
|
||||
@@ -344,6 +348,40 @@ static const struct usb_device_id usb_amd_resume_quirk_list[] = {
|
||||
{ } /* terminating entry must be last */
|
||||
};
|
||||
|
||||
+/*
|
||||
+ * Entries for blacklisted endpoints that should be ignored when parsing
|
||||
+ * configuration descriptors.
|
||||
+ *
|
||||
+ * Matched for devices with USB_QUIRK_ENDPOINT_BLACKLIST.
|
||||
+ */
|
||||
+static const struct usb_device_id usb_endpoint_blacklist[] = {
|
||||
+ { USB_DEVICE_INTERFACE_NUMBER(0x06f8, 0xb000, 5), .driver_info = 0x01 },
|
||||
+ { USB_DEVICE_INTERFACE_NUMBER(0x06f8, 0xb000, 5), .driver_info = 0x81 },
|
||||
+ { }
|
||||
+};
|
||||
+
|
||||
+bool usb_endpoint_is_blacklisted(struct usb_device *udev,
|
||||
+ struct usb_host_interface *intf,
|
||||
+ struct usb_endpoint_descriptor *epd)
|
||||
+{
|
||||
+ const struct usb_device_id *id;
|
||||
+ unsigned int address;
|
||||
+
|
||||
+ for (id = usb_endpoint_blacklist; id->match_flags; ++id) {
|
||||
+ if (!usb_match_device(udev, id))
|
||||
+ continue;
|
||||
+
|
||||
+ if (!usb_match_one_id_intf(udev, intf, id))
|
||||
+ continue;
|
||||
+
|
||||
+ address = id->driver_info;
|
||||
+ if (address == epd->bEndpointAddress)
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
static bool usb_match_any_interface(struct usb_device *udev,
|
||||
const struct usb_device_id *id)
|
||||
{
|
||||
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
|
||||
index 6b2f115442838..462a00c749b87 100644
|
||||
--- a/drivers/usb/core/usb.h
|
||||
+++ b/drivers/usb/core/usb.h
|
||||
@@ -31,6 +31,9 @@ extern void usb_deauthorize_interface(struct usb_interface *);
|
||||
extern void usb_authorize_interface(struct usb_interface *);
|
||||
extern void usb_detect_quirks(struct usb_device *udev);
|
||||
extern void usb_detect_interface_quirks(struct usb_device *udev);
|
||||
+extern bool usb_endpoint_is_blacklisted(struct usb_device *udev,
|
||||
+ struct usb_host_interface *intf,
|
||||
+ struct usb_endpoint_descriptor *epd);
|
||||
extern int usb_remove_device(struct usb_device *udev);
|
||||
|
||||
extern int usb_get_device_descriptor(struct usb_device *dev,
|
||||
diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
|
||||
index e2451bdb4525d..299412abb1658 100644
|
||||
--- a/drivers/video/fbdev/hyperv_fb.c
|
||||
+++ b/drivers/video/fbdev/hyperv_fb.c
|
||||
@@ -712,7 +712,12 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
|
||||
goto err1;
|
||||
}
|
||||
|
||||
- fb_virt = ioremap(par->mem->start, screen_fb_size);
|
||||
+ /*
|
||||
+ * Map the VRAM cacheable for performance. This is also required for
|
||||
+ * VM Connect to display properly for ARM64 Linux VM, as the host also
|
||||
+ * maps the VRAM cacheable.
|
||||
+ */
|
||||
+ fb_virt = ioremap_cache(par->mem->start, screen_fb_size);
|
||||
if (!fb_virt)
|
||||
goto err2;
|
||||
|
||||
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
|
||||
index b1125778b9080..9e1f9910bdf2d 100644
|
||||
--- a/fs/btrfs/inode.c
|
||||
+++ b/fs/btrfs/inode.c
|
||||
@@ -5370,11 +5370,13 @@ no_delete:
|
||||
}
|
||||
|
||||
/*
|
||||
- * this returns the key found in the dir entry in the location pointer.
|
||||
+ * Return the key found in the dir entry in the location pointer, fill @type
|
||||
+ * with BTRFS_FT_*, and return 0.
|
||||
+ *
|
||||
* If no dir entries were found, location->objectid is 0.
|
||||
*/
|
||||
static int btrfs_inode_by_name(struct inode *dir, struct dentry *dentry,
|
||||
- struct btrfs_key *location)
|
||||
+ struct btrfs_key *location, u8 *type)
|
||||
{
|
||||
const char *name = dentry->d_name.name;
|
||||
int namelen = dentry->d_name.len;
|
||||
@@ -5396,6 +5398,8 @@ static int btrfs_inode_by_name(struct inode *dir, struct dentry *dentry,
|
||||
goto out_err;
|
||||
|
||||
btrfs_dir_item_key_to_cpu(path->nodes[0], di, location);
|
||||
+ if (!ret)
|
||||
+ *type = btrfs_dir_type(path->nodes[0], di);
|
||||
out:
|
||||
btrfs_free_path(path);
|
||||
return ret;
|
||||
@@ -5681,19 +5685,25 @@ static struct inode *new_simple_dir(struct super_block *s,
|
||||
return inode;
|
||||
}
|
||||
|
||||
+static inline u8 btrfs_inode_type(struct inode *inode)
|
||||
+{
|
||||
+ return btrfs_type_by_mode[(inode->i_mode & S_IFMT) >> S_SHIFT];
|
||||
+}
|
||||
+
|
||||
struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry)
|
||||
{
|
||||
struct inode *inode;
|
||||
struct btrfs_root *root = BTRFS_I(dir)->root;
|
||||
struct btrfs_root *sub_root = root;
|
||||
struct btrfs_key location;
|
||||
+ u8 di_type = 0;
|
||||
int index;
|
||||
int ret = 0;
|
||||
|
||||
if (dentry->d_name.len > BTRFS_NAME_LEN)
|
||||
return ERR_PTR(-ENAMETOOLONG);
|
||||
|
||||
- ret = btrfs_inode_by_name(dir, dentry, &location);
|
||||
+ ret = btrfs_inode_by_name(dir, dentry, &location, &di_type);
|
||||
if (ret < 0)
|
||||
return ERR_PTR(ret);
|
||||
|
||||
@@ -5702,6 +5712,18 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry)
|
||||
|
||||
if (location.type == BTRFS_INODE_ITEM_KEY) {
|
||||
inode = btrfs_iget(dir->i_sb, &location, root, NULL);
|
||||
+ if (IS_ERR(inode))
|
||||
+ return inode;
|
||||
+
|
||||
+ /* Do extra check against inode mode with di_type */
|
||||
+ if (btrfs_inode_type(inode) != di_type) {
|
||||
+ btrfs_crit(root->fs_info,
|
||||
+"inode mode mismatch with dir: inode mode=0%o btrfs type=%u dir type=%u",
|
||||
+ inode->i_mode, btrfs_inode_type(inode),
|
||||
+ di_type);
|
||||
+ iput(inode);
|
||||
+ return ERR_PTR(-EUCLEAN);
|
||||
+ }
|
||||
return inode;
|
||||
}
|
||||
|
||||
@@ -6315,11 +6337,6 @@ fail:
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
-static inline u8 btrfs_inode_type(struct inode *inode)
|
||||
-{
|
||||
- return btrfs_type_by_mode[(inode->i_mode & S_IFMT) >> S_SHIFT];
|
||||
-}
|
||||
-
|
||||
/*
|
||||
* utility function to add 'inode' into 'parent_inode' with
|
||||
* a give name and a given sequence number.
|
||||
@@ -6904,6 +6921,14 @@ again:
|
||||
extent_start = found_key.offset;
|
||||
if (found_type == BTRFS_FILE_EXTENT_REG ||
|
||||
found_type == BTRFS_FILE_EXTENT_PREALLOC) {
|
||||
+ /* Only regular file could have regular/prealloc extent */
|
||||
+ if (!S_ISREG(inode->i_mode)) {
|
||||
+ ret = -EUCLEAN;
|
||||
+ btrfs_crit(root->fs_info,
|
||||
+ "regular/prealloc extent found for non-regular inode %llu",
|
||||
+ btrfs_ino(inode));
|
||||
+ goto out;
|
||||
+ }
|
||||
extent_end = extent_start +
|
||||
btrfs_file_extent_num_bytes(leaf, item);
|
||||
} else if (found_type == BTRFS_FILE_EXTENT_INLINE) {
|
||||
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
|
||||
index 734babb6626c4..18e667fbd054d 100644
|
||||
--- a/fs/btrfs/qgroup.c
|
||||
+++ b/fs/btrfs/qgroup.c
|
||||
@@ -462,6 +462,7 @@ next2:
|
||||
break;
|
||||
}
|
||||
out:
|
||||
+ btrfs_free_path(path);
|
||||
fs_info->qgroup_flags |= flags;
|
||||
if (!(fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_ON)) {
|
||||
fs_info->quota_enabled = 0;
|
||||
@@ -470,7 +471,6 @@ out:
|
||||
ret >= 0) {
|
||||
ret = qgroup_rescan_init(fs_info, rescan_progress, 0);
|
||||
}
|
||||
- btrfs_free_path(path);
|
||||
|
||||
if (ret < 0) {
|
||||
ulist_free(fs_info->qgroup_ulist);
|
||||
diff --git a/fs/btrfs/tests/inode-tests.c b/fs/btrfs/tests/inode-tests.c
|
||||
index 054fc0d97131b..5ff676df698f0 100644
|
||||
--- a/fs/btrfs/tests/inode-tests.c
|
||||
+++ b/fs/btrfs/tests/inode-tests.c
|
||||
@@ -235,6 +235,7 @@ static noinline int test_btrfs_get_extent(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ inode->i_mode = S_IFREG;
|
||||
BTRFS_I(inode)->location.type = BTRFS_INODE_ITEM_KEY;
|
||||
BTRFS_I(inode)->location.objectid = BTRFS_FIRST_FREE_OBJECTID;
|
||||
BTRFS_I(inode)->location.offset = 0;
|
||||
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
|
||||
index 2d10b818399b1..cd1e9411f9269 100644
|
||||
--- a/fs/btrfs/volumes.c
|
||||
+++ b/fs/btrfs/volumes.c
|
||||
@@ -6262,6 +6262,13 @@ static int btrfs_check_chunk_valid(struct btrfs_root *root,
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
+ if (!is_power_of_2(type & BTRFS_BLOCK_GROUP_PROFILE_MASK) &&
|
||||
+ (type & BTRFS_BLOCK_GROUP_PROFILE_MASK) != 0) {
|
||||
+ btrfs_err(root->fs_info,
|
||||
+ "invalid chunk profile flag: 0x%llx, expect 0 or 1 bit set",
|
||||
+ type & BTRFS_BLOCK_GROUP_PROFILE_MASK);
|
||||
+ return -EUCLEAN;
|
||||
+ }
|
||||
if ((type & BTRFS_BLOCK_GROUP_TYPE_MASK) == 0) {
|
||||
btrfs_err(root->fs_info, "missing chunk type flag: 0x%llx", type);
|
||||
return -EIO;
|
||||
diff --git a/fs/efivarfs/inode.c b/fs/efivarfs/inode.c
|
||||
index e2ab6d0497f2b..151884b95ee2f 100644
|
||||
--- a/fs/efivarfs/inode.c
|
||||
+++ b/fs/efivarfs/inode.c
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <linux/efi.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ctype.h>
|
||||
+#include <linux/kmemleak.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include "internal.h"
|
||||
@@ -138,6 +139,7 @@ static int efivarfs_create(struct inode *dir, struct dentry *dentry,
|
||||
var->var.VariableName[i] = '\0';
|
||||
|
||||
inode->i_private = var;
|
||||
+ kmemleak_ignore(var);
|
||||
|
||||
efivar_entry_add(var, &efivarfs_list);
|
||||
d_instantiate(dentry, inode);
|
||||
diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
|
||||
index 0e4f20377d196..fca235020312d 100644
|
||||
--- a/fs/efivarfs/super.c
|
||||
+++ b/fs/efivarfs/super.c
|
||||
@@ -23,7 +23,6 @@ LIST_HEAD(efivarfs_list);
|
||||
static void efivarfs_evict_inode(struct inode *inode)
|
||||
{
|
||||
clear_inode(inode);
|
||||
- kfree(inode->i_private);
|
||||
}
|
||||
|
||||
static const struct super_operations efivarfs_ops = {
|
||||
diff --git a/fs/proc/self.c b/fs/proc/self.c
|
||||
index 2dcc2558b3aa7..dffbe533d53fc 100644
|
||||
--- a/fs/proc/self.c
|
||||
+++ b/fs/proc/self.c
|
||||
@@ -24,6 +24,13 @@ static const char *proc_self_follow_link(struct dentry *dentry, void **cookie)
|
||||
pid_t tgid = task_tgid_nr_ns(current, ns);
|
||||
char *name;
|
||||
|
||||
+ /*
|
||||
+ * Not currently supported. Once we can inherit all of struct pid,
|
||||
+ * we can allow this.
|
||||
+ */
|
||||
+ if (current->flags & PF_KTHREAD)
|
||||
+ return ERR_PTR(-EOPNOTSUPP);
|
||||
+
|
||||
if (!tgid)
|
||||
return ERR_PTR(-ENOENT);
|
||||
/* 11 for max length of signed int in decimal + NULL term */
|
||||
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
|
||||
index ea4f81c2a6d5e..602dff213bae1 100644
|
||||
--- a/include/linux/usb/quirks.h
|
||||
+++ b/include/linux/usb/quirks.h
|
||||
@@ -59,4 +59,7 @@
|
||||
/* Device needs a pause after every control message. */
|
||||
#define USB_QUIRK_DELAY_CTRL_MSG BIT(13)
|
||||
|
||||
+/* device has blacklisted endpoints */
|
||||
+#define USB_QUIRK_ENDPOINT_BLACKLIST BIT(15)
|
||||
+
|
||||
#endif /* __LINUX_USB_QUIRKS_H */
|
||||
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
|
||||
index c7b1dc713cdd7..9c7f4aad6db66 100644
|
||||
--- a/include/scsi/libiscsi.h
|
||||
+++ b/include/scsi/libiscsi.h
|
||||
@@ -144,6 +144,9 @@ struct iscsi_task {
|
||||
void *dd_data; /* driver/transport data */
|
||||
};
|
||||
|
||||
+/* invalid scsi_task pointer */
|
||||
+#define INVALID_SCSI_TASK (struct iscsi_task *)-1l
|
||||
+
|
||||
static inline int iscsi_task_has_unsol_data(struct iscsi_task *task)
|
||||
{
|
||||
return task->unsol_r2t.data_length > task->unsol_r2t.sent;
|
||||
diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
|
||||
index fd460aca36e55..40e4c933b3728 100644
|
||||
--- a/tools/perf/util/dwarf-aux.c
|
||||
+++ b/tools/perf/util/dwarf-aux.c
|
||||
@@ -305,6 +305,7 @@ bool die_is_func_def(Dwarf_Die *dw_die)
|
||||
int die_entrypc(Dwarf_Die *dw_die, Dwarf_Addr *addr)
|
||||
{
|
||||
Dwarf_Addr base, end;
|
||||
+ Dwarf_Attribute attr;
|
||||
|
||||
if (!addr)
|
||||
return -EINVAL;
|
||||
@@ -312,6 +313,13 @@ int die_entrypc(Dwarf_Die *dw_die, Dwarf_Addr *addr)
|
||||
if (dwarf_entrypc(dw_die, addr) == 0)
|
||||
return 0;
|
||||
|
||||
+ /*
|
||||
+ * Since the dwarf_ranges() will return 0 if there is no
|
||||
+ * DW_AT_ranges attribute, we should check it first.
|
||||
+ */
|
||||
+ if (!dwarf_attr(dw_die, DW_AT_ranges, &attr))
|
||||
+ return -ENOENT;
|
||||
+
|
||||
return dwarf_ranges(dw_die, 0, &base, addr, &end) < 0 ? -ENOENT : 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user