Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.19 commit in: /
Date: Sat, 04 May 2019 18:28:39
Message-Id: 1556994500.c517b4f40cdffe3448eec0d4930009ae0d6b416f.mpagano@gentoo
1 commit: c517b4f40cdffe3448eec0d4930009ae0d6b416f
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 4 18:28:20 2019 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Sat May 4 18:28:20 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=c517b4f4
7
8 Linux patch 4.19.39
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1038_linux-4.19.39.patch | 2295 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 2299 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index ad3e29c..be92968 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -195,6 +195,10 @@ Patch: 1037_linux-4.19.38.patch
21 From: http://www.kernel.org
22 Desc: Linux 4.19.38
23
24 +Patch: 1038_linux-4.19.39.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 4.19.39
27 +
28 Patch: 1500_XATTR_USER_PREFIX.patch
29 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
30 Desc: Support for namespace user.pax.* on tmpfs.
31
32 diff --git a/1038_linux-4.19.39.patch b/1038_linux-4.19.39.patch
33 new file mode 100644
34 index 0000000..489af44
35 --- /dev/null
36 +++ b/1038_linux-4.19.39.patch
37 @@ -0,0 +1,2295 @@
38 +diff --git a/Documentation/i2c/busses/i2c-i801 b/Documentation/i2c/busses/i2c-i801
39 +index d1ee484a787d..ee9984f35868 100644
40 +--- a/Documentation/i2c/busses/i2c-i801
41 ++++ b/Documentation/i2c/busses/i2c-i801
42 +@@ -36,6 +36,7 @@ Supported adapters:
43 + * Intel Cannon Lake (PCH)
44 + * Intel Cedar Fork (PCH)
45 + * Intel Ice Lake (PCH)
46 ++ * Intel Comet Lake (PCH)
47 + Datasheets: Publicly available at the Intel website
48 +
49 + On Intel Patsburg and later chipsets, both the normal host SMBus controller
50 +diff --git a/Makefile b/Makefile
51 +index 14d4aeb48907..be1bd297bca9 100644
52 +--- a/Makefile
53 ++++ b/Makefile
54 +@@ -1,7 +1,7 @@
55 + # SPDX-License-Identifier: GPL-2.0
56 + VERSION = 4
57 + PATCHLEVEL = 19
58 +-SUBLEVEL = 38
59 ++SUBLEVEL = 39
60 + EXTRAVERSION =
61 + NAME = "People's Front"
62 +
63 +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
64 +index cd4c74daf71e..51794c7fa6d5 100644
65 +--- a/arch/arm/Kconfig
66 ++++ b/arch/arm/Kconfig
67 +@@ -612,6 +612,7 @@ config ARCH_DAVINCI
68 + select HAVE_IDE
69 + select PM_GENERIC_DOMAINS if PM
70 + select PM_GENERIC_DOMAINS_OF if PM && OF
71 ++ select REGMAP_MMIO
72 + select RESET_CONTROLLER
73 + select USE_OF
74 + select ZONE_DMA
75 +diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
76 +index 5641d162dfdb..28e7513ce617 100644
77 +--- a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
78 ++++ b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
79 +@@ -93,7 +93,7 @@
80 + };
81 +
82 + &hdmi {
83 +- hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
84 ++ hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
85 + };
86 +
87 + &pwm {
88 +diff --git a/arch/arm/boot/dts/imx6qdl-icore-rqs.dtsi b/arch/arm/boot/dts/imx6qdl-icore-rqs.dtsi
89 +index acc3b11fba2a..cde3025d9603 100644
90 +--- a/arch/arm/boot/dts/imx6qdl-icore-rqs.dtsi
91 ++++ b/arch/arm/boot/dts/imx6qdl-icore-rqs.dtsi
92 +@@ -298,7 +298,7 @@
93 + pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
94 + vmcc-supply = <&reg_sd3_vmmc>;
95 + cd-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
96 +- bus-witdh = <4>;
97 ++ bus-width = <4>;
98 + no-1-8-v;
99 + status = "okay";
100 + };
101 +@@ -309,7 +309,7 @@
102 + pinctrl-1 = <&pinctrl_usdhc4_100mhz>;
103 + pinctrl-2 = <&pinctrl_usdhc4_200mhz>;
104 + vmcc-supply = <&reg_sd4_vmmc>;
105 +- bus-witdh = <8>;
106 ++ bus-width = <8>;
107 + no-1-8-v;
108 + non-removable;
109 + status = "okay";
110 +diff --git a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
111 +index ed1aafd56973..fe4e89d773f5 100644
112 +--- a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
113 ++++ b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
114 +@@ -89,6 +89,7 @@
115 + pinctrl-names = "default";
116 + pinctrl-0 = <&pinctrl_enet>;
117 + phy-mode = "rgmii";
118 ++ phy-reset-duration = <10>; /* in msecs */
119 + phy-reset-gpios = <&gpio3 23 GPIO_ACTIVE_LOW>;
120 + phy-supply = <&vdd_eth_io_reg>;
121 + status = "disabled";
122 +diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
123 +index 265ea9cf7df7..523c499e42db 100644
124 +--- a/arch/arm/include/asm/kvm_mmu.h
125 ++++ b/arch/arm/include/asm/kvm_mmu.h
126 +@@ -317,6 +317,17 @@ static inline int kvm_read_guest_lock(struct kvm *kvm,
127 + return ret;
128 + }
129 +
130 ++static inline int kvm_write_guest_lock(struct kvm *kvm, gpa_t gpa,
131 ++ const void *data, unsigned long len)
132 ++{
133 ++ int srcu_idx = srcu_read_lock(&kvm->srcu);
134 ++ int ret = kvm_write_guest(kvm, gpa, data, len);
135 ++
136 ++ srcu_read_unlock(&kvm->srcu, srcu_idx);
137 ++
138 ++ return ret;
139 ++}
140 ++
141 + static inline void *kvm_get_hyp_vector(void)
142 + {
143 + switch(read_cpuid_part()) {
144 +diff --git a/arch/arm/mach-imx/mach-imx51.c b/arch/arm/mach-imx/mach-imx51.c
145 +index c7169c2f94c4..08c7892866c2 100644
146 +--- a/arch/arm/mach-imx/mach-imx51.c
147 ++++ b/arch/arm/mach-imx/mach-imx51.c
148 +@@ -59,6 +59,7 @@ static void __init imx51_m4if_setup(void)
149 + return;
150 +
151 + m4if_base = of_iomap(np, 0);
152 ++ of_node_put(np);
153 + if (!m4if_base) {
154 + pr_err("Unable to map M4IF registers\n");
155 + return;
156 +diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
157 +index d6fff7de5539..b2558447c67d 100644
158 +--- a/arch/arm64/include/asm/kvm_mmu.h
159 ++++ b/arch/arm64/include/asm/kvm_mmu.h
160 +@@ -394,6 +394,17 @@ static inline int kvm_read_guest_lock(struct kvm *kvm,
161 + return ret;
162 + }
163 +
164 ++static inline int kvm_write_guest_lock(struct kvm *kvm, gpa_t gpa,
165 ++ const void *data, unsigned long len)
166 ++{
167 ++ int srcu_idx = srcu_read_lock(&kvm->srcu);
168 ++ int ret = kvm_write_guest(kvm, gpa, data, len);
169 ++
170 ++ srcu_read_unlock(&kvm->srcu, srcu_idx);
171 ++
172 ++ return ret;
173 ++}
174 ++
175 + #ifdef CONFIG_KVM_INDIRECT_VECTORS
176 + /*
177 + * EL2 vectors can be mapped and rerouted in a number of ways,
178 +diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c
179 +index 18b9a522a2b3..0688816f19e2 100644
180 +--- a/arch/arm64/kvm/reset.c
181 ++++ b/arch/arm64/kvm/reset.c
182 +@@ -117,6 +117,9 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
183 + int ret = -EINVAL;
184 + bool loaded;
185 +
186 ++ /* Reset PMU outside of the non-preemptible section */
187 ++ kvm_pmu_vcpu_reset(vcpu);
188 ++
189 + preempt_disable();
190 + loaded = (vcpu->cpu != -1);
191 + if (loaded)
192 +@@ -164,9 +167,6 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
193 + vcpu->arch.reset_state.reset = false;
194 + }
195 +
196 +- /* Reset PMU */
197 +- kvm_pmu_vcpu_reset(vcpu);
198 +-
199 + /* Default workaround setup is enabled (if supported) */
200 + if (kvm_arm_have_ssbd() == KVM_SSBD_KERNEL)
201 + vcpu->arch.workaround_flags |= VCPU_WORKAROUND_2_FLAG;
202 +diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
203 +index 7d22a474a040..f74639a05f0f 100644
204 +--- a/arch/s390/include/asm/elf.h
205 ++++ b/arch/s390/include/asm/elf.h
206 +@@ -252,11 +252,14 @@ do { \
207 +
208 + /*
209 + * Cache aliasing on the latest machines calls for a mapping granularity
210 +- * of 512KB. For 64-bit processes use a 512KB alignment and a randomization
211 +- * of up to 1GB. For 31-bit processes the virtual address space is limited,
212 +- * use no alignment and limit the randomization to 8MB.
213 ++ * of 512KB for the anonymous mapping base. For 64-bit processes use a
214 ++ * 512KB alignment and a randomization of up to 1GB. For 31-bit processes
215 ++ * the virtual address space is limited, use no alignment and limit the
216 ++ * randomization to 8MB.
217 ++ * For the additional randomization of the program break use 32MB for
218 ++ * 64-bit and 8MB for 31-bit.
219 + */
220 +-#define BRK_RND_MASK (is_compat_task() ? 0x7ffUL : 0x3ffffUL)
221 ++#define BRK_RND_MASK (is_compat_task() ? 0x7ffUL : 0x1fffUL)
222 + #define MMAP_RND_MASK (is_compat_task() ? 0x7ffUL : 0x3ff80UL)
223 + #define MMAP_ALIGN_MASK (is_compat_task() ? 0 : 0x7fUL)
224 + #define STACK_RND_MASK MMAP_RND_MASK
225 +diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
226 +index 1e95d57760cf..b69f7d428443 100644
227 +--- a/arch/x86/mm/mmap.c
228 ++++ b/arch/x86/mm/mmap.c
229 +@@ -230,7 +230,7 @@ bool mmap_address_hint_valid(unsigned long addr, unsigned long len)
230 + /* Can we access it for direct reading/writing? Must be RAM: */
231 + int valid_phys_addr_range(phys_addr_t addr, size_t count)
232 + {
233 +- return addr + count <= __pa(high_memory);
234 ++ return addr + count - 1 <= __pa(high_memory - 1);
235 + }
236 +
237 + /* Can we access it through mmap? Must be a valid physical address: */
238 +diff --git a/arch/x86/realmode/init.c b/arch/x86/realmode/init.c
239 +index d10105825d57..47d097946872 100644
240 +--- a/arch/x86/realmode/init.c
241 ++++ b/arch/x86/realmode/init.c
242 +@@ -20,8 +20,6 @@ void __init set_real_mode_mem(phys_addr_t mem, size_t size)
243 + void *base = __va(mem);
244 +
245 + real_mode_header = (struct real_mode_header *) base;
246 +- printk(KERN_DEBUG "Base memory trampoline at [%p] %llx size %zu\n",
247 +- base, (unsigned long long)mem, size);
248 + }
249 +
250 + void __init reserve_real_mode(void)
251 +diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
252 +index 4424997ecf30..e10fec99a182 100644
253 +--- a/drivers/acpi/acpica/evgpe.c
254 ++++ b/drivers/acpi/acpica/evgpe.c
255 +@@ -81,12 +81,8 @@ acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)
256 +
257 + ACPI_FUNCTION_TRACE(ev_enable_gpe);
258 +
259 +- /* Clear the GPE status */
260 +- status = acpi_hw_clear_gpe(gpe_event_info);
261 +- if (ACPI_FAILURE(status))
262 +- return_ACPI_STATUS(status);
263 +-
264 + /* Enable the requested GPE */
265 ++
266 + status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_ENABLE);
267 + return_ACPI_STATUS(status);
268 + }
269 +diff --git a/drivers/ata/libata-zpodd.c b/drivers/ata/libata-zpodd.c
270 +index b3ed8f9953a8..173e6f2dd9af 100644
271 +--- a/drivers/ata/libata-zpodd.c
272 ++++ b/drivers/ata/libata-zpodd.c
273 +@@ -52,38 +52,52 @@ static int eject_tray(struct ata_device *dev)
274 + /* Per the spec, only slot type and drawer type ODD can be supported */
275 + static enum odd_mech_type zpodd_get_mech_type(struct ata_device *dev)
276 + {
277 +- char buf[16];
278 ++ char *buf;
279 + unsigned int ret;
280 +- struct rm_feature_desc *desc = (void *)(buf + 8);
281 ++ struct rm_feature_desc *desc;
282 + struct ata_taskfile tf;
283 + static const char cdb[] = { GPCMD_GET_CONFIGURATION,
284 + 2, /* only 1 feature descriptor requested */
285 + 0, 3, /* 3, removable medium feature */
286 + 0, 0, 0,/* reserved */
287 +- 0, sizeof(buf),
288 ++ 0, 16,
289 + 0, 0, 0,
290 + };
291 +
292 ++ buf = kzalloc(16, GFP_KERNEL);
293 ++ if (!buf)
294 ++ return ODD_MECH_TYPE_UNSUPPORTED;
295 ++ desc = (void *)(buf + 8);
296 ++
297 + ata_tf_init(dev, &tf);
298 + tf.flags = ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
299 + tf.command = ATA_CMD_PACKET;
300 + tf.protocol = ATAPI_PROT_PIO;
301 +- tf.lbam = sizeof(buf);
302 ++ tf.lbam = 16;
303 +
304 + ret = ata_exec_internal(dev, &tf, cdb, DMA_FROM_DEVICE,
305 +- buf, sizeof(buf), 0);
306 +- if (ret)
307 ++ buf, 16, 0);
308 ++ if (ret) {
309 ++ kfree(buf);
310 + return ODD_MECH_TYPE_UNSUPPORTED;
311 ++ }
312 +
313 +- if (be16_to_cpu(desc->feature_code) != 3)
314 ++ if (be16_to_cpu(desc->feature_code) != 3) {
315 ++ kfree(buf);
316 + return ODD_MECH_TYPE_UNSUPPORTED;
317 ++ }
318 +
319 +- if (desc->mech_type == 0 && desc->load == 0 && desc->eject == 1)
320 ++ if (desc->mech_type == 0 && desc->load == 0 && desc->eject == 1) {
321 ++ kfree(buf);
322 + return ODD_MECH_TYPE_SLOT;
323 +- else if (desc->mech_type == 1 && desc->load == 0 && desc->eject == 1)
324 ++ } else if (desc->mech_type == 1 && desc->load == 0 &&
325 ++ desc->eject == 1) {
326 ++ kfree(buf);
327 + return ODD_MECH_TYPE_DRAWER;
328 +- else
329 ++ } else {
330 ++ kfree(buf);
331 + return ODD_MECH_TYPE_UNSUPPORTED;
332 ++ }
333 + }
334 +
335 + /* Test if ODD is zero power ready by sense code */
336 +diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c
337 +index 2342e154029b..b696ec35efb3 100644
338 +--- a/drivers/gpio/gpio-aspeed.c
339 ++++ b/drivers/gpio/gpio-aspeed.c
340 +@@ -1225,6 +1225,8 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)
341 +
342 + gpio->offset_timer =
343 + devm_kzalloc(&pdev->dev, gpio->chip.ngpio, GFP_KERNEL);
344 ++ if (!gpio->offset_timer)
345 ++ return -ENOMEM;
346 +
347 + return aspeed_gpio_setup_irqs(gpio, pdev);
348 + }
349 +diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
350 +index d4e7a09598fa..e0f149bdf98f 100644
351 +--- a/drivers/gpio/gpiolib-of.c
352 ++++ b/drivers/gpio/gpiolib-of.c
353 +@@ -646,7 +646,13 @@ int of_gpiochip_add(struct gpio_chip *chip)
354 +
355 + of_node_get(chip->of_node);
356 +
357 +- return of_gpiochip_scan_gpios(chip);
358 ++ status = of_gpiochip_scan_gpios(chip);
359 ++ if (status) {
360 ++ of_node_put(chip->of_node);
361 ++ gpiochip_remove_pin_ranges(chip);
362 ++ }
363 ++
364 ++ return status;
365 + }
366 +
367 + void of_gpiochip_remove(struct gpio_chip *chip)
368 +diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
369 +index ea4941da9b27..0201ccb22f4c 100644
370 +--- a/drivers/gpu/drm/drm_drv.c
371 ++++ b/drivers/gpu/drm/drm_drv.c
372 +@@ -381,11 +381,7 @@ void drm_dev_unplug(struct drm_device *dev)
373 + synchronize_srcu(&drm_unplug_srcu);
374 +
375 + drm_dev_unregister(dev);
376 +-
377 +- mutex_lock(&drm_global_mutex);
378 +- if (dev->open_count == 0)
379 +- drm_dev_put(dev);
380 +- mutex_unlock(&drm_global_mutex);
381 ++ drm_dev_put(dev);
382 + }
383 + EXPORT_SYMBOL(drm_dev_unplug);
384 +
385 +diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
386 +index ffa8dc35515f..e4ccb52c67ea 100644
387 +--- a/drivers/gpu/drm/drm_file.c
388 ++++ b/drivers/gpu/drm/drm_file.c
389 +@@ -479,11 +479,9 @@ int drm_release(struct inode *inode, struct file *filp)
390 +
391 + drm_file_free(file_priv);
392 +
393 +- if (!--dev->open_count) {
394 ++ if (!--dev->open_count)
395 + drm_lastclose(dev);
396 +- if (drm_dev_is_unplugged(dev))
397 +- drm_put_dev(dev);
398 +- }
399 ++
400 + mutex_unlock(&drm_global_mutex);
401 +
402 + drm_minor_release(minor);
403 +diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
404 +index 611ac340fb28..588b3b0c8315 100644
405 +--- a/drivers/gpu/drm/meson/meson_drv.c
406 ++++ b/drivers/gpu/drm/meson/meson_drv.c
407 +@@ -300,10 +300,12 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
408 +
409 + ret = drm_dev_register(drm, 0);
410 + if (ret)
411 +- goto free_drm;
412 ++ goto uninstall_irq;
413 +
414 + return 0;
415 +
416 ++uninstall_irq:
417 ++ drm_irq_uninstall(drm);
418 + free_drm:
419 + drm_dev_put(drm);
420 +
421 +@@ -317,10 +319,11 @@ static int meson_drv_bind(struct device *dev)
422 +
423 + static void meson_drv_unbind(struct device *dev)
424 + {
425 +- struct drm_device *drm = dev_get_drvdata(dev);
426 +- struct meson_drm *priv = drm->dev_private;
427 ++ struct meson_drm *priv = dev_get_drvdata(dev);
428 ++ struct drm_device *drm = priv->drm;
429 +
430 + drm_dev_unregister(drm);
431 ++ drm_irq_uninstall(drm);
432 + drm_kms_helper_poll_fini(drm);
433 + drm_fbdev_cma_fini(priv->fbdev);
434 + drm_mode_config_cleanup(drm);
435 +diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c
436 +index 8f4fcbb515fb..bb97cad1eb69 100644
437 +--- a/drivers/gpu/drm/tegra/hub.c
438 ++++ b/drivers/gpu/drm/tegra/hub.c
439 +@@ -378,14 +378,16 @@ static int tegra_shared_plane_atomic_check(struct drm_plane *plane,
440 + static void tegra_shared_plane_atomic_disable(struct drm_plane *plane,
441 + struct drm_plane_state *old_state)
442 + {
443 +- struct tegra_dc *dc = to_tegra_dc(old_state->crtc);
444 + struct tegra_plane *p = to_tegra_plane(plane);
445 ++ struct tegra_dc *dc;
446 + u32 value;
447 +
448 + /* rien ne va plus */
449 + if (!old_state || !old_state->crtc)
450 + return;
451 +
452 ++ dc = to_tegra_dc(old_state->crtc);
453 ++
454 + /*
455 + * XXX Legacy helpers seem to sometimes call ->atomic_disable() even
456 + * on planes that are already disabled. Make sure we fallback to the
457 +diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
458 +index ac4b09642f63..8f803812ea24 100644
459 +--- a/drivers/i2c/busses/Kconfig
460 ++++ b/drivers/i2c/busses/Kconfig
461 +@@ -131,6 +131,7 @@ config I2C_I801
462 + Cannon Lake (PCH)
463 + Cedar Fork (PCH)
464 + Ice Lake (PCH)
465 ++ Comet Lake (PCH)
466 +
467 + This driver can also be built as a module. If so, the module
468 + will be called i2c-i801.
469 +diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
470 +index c91e145ef5a5..679c6c41f64b 100644
471 +--- a/drivers/i2c/busses/i2c-i801.c
472 ++++ b/drivers/i2c/busses/i2c-i801.c
473 +@@ -71,6 +71,7 @@
474 + * Cannon Lake-LP (PCH) 0x9da3 32 hard yes yes yes
475 + * Cedar Fork (PCH) 0x18df 32 hard yes yes yes
476 + * Ice Lake-LP (PCH) 0x34a3 32 hard yes yes yes
477 ++ * Comet Lake (PCH) 0x02a3 32 hard yes yes yes
478 + *
479 + * Features supported by this driver:
480 + * Software PEC no
481 +@@ -240,6 +241,7 @@
482 + #define PCI_DEVICE_ID_INTEL_LEWISBURG_SSKU_SMBUS 0xa223
483 + #define PCI_DEVICE_ID_INTEL_KABYLAKE_PCH_H_SMBUS 0xa2a3
484 + #define PCI_DEVICE_ID_INTEL_CANNONLAKE_H_SMBUS 0xa323
485 ++#define PCI_DEVICE_ID_INTEL_COMETLAKE_SMBUS 0x02a3
486 +
487 + struct i801_mux_config {
488 + char *gpio_chip;
489 +@@ -1038,6 +1040,7 @@ static const struct pci_device_id i801_ids[] = {
490 + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CANNONLAKE_H_SMBUS) },
491 + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CANNONLAKE_LP_SMBUS) },
492 + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICELAKE_LP_SMBUS) },
493 ++ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_COMETLAKE_SMBUS) },
494 + { 0, }
495 + };
496 +
497 +@@ -1534,6 +1537,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
498 + case PCI_DEVICE_ID_INTEL_DNV_SMBUS:
499 + case PCI_DEVICE_ID_INTEL_KABYLAKE_PCH_H_SMBUS:
500 + case PCI_DEVICE_ID_INTEL_ICELAKE_LP_SMBUS:
501 ++ case PCI_DEVICE_ID_INTEL_COMETLAKE_SMBUS:
502 + priv->features |= FEATURE_I2C_BLOCK_READ;
503 + priv->features |= FEATURE_IRQ;
504 + priv->features |= FEATURE_SMBUS_PEC;
505 +diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
506 +index 0b3877681e4a..8d9920ff4134 100644
507 +--- a/drivers/iommu/amd_iommu.c
508 ++++ b/drivers/iommu/amd_iommu.c
509 +@@ -3119,21 +3119,24 @@ static void amd_iommu_get_resv_regions(struct device *dev,
510 + return;
511 +
512 + list_for_each_entry(entry, &amd_iommu_unity_map, list) {
513 ++ int type, prot = 0;
514 + size_t length;
515 +- int prot = 0;
516 +
517 + if (devid < entry->devid_start || devid > entry->devid_end)
518 + continue;
519 +
520 ++ type = IOMMU_RESV_DIRECT;
521 + length = entry->address_end - entry->address_start;
522 + if (entry->prot & IOMMU_PROT_IR)
523 + prot |= IOMMU_READ;
524 + if (entry->prot & IOMMU_PROT_IW)
525 + prot |= IOMMU_WRITE;
526 ++ if (entry->prot & IOMMU_UNITY_MAP_FLAG_EXCL_RANGE)
527 ++ /* Exclusion range */
528 ++ type = IOMMU_RESV_RESERVED;
529 +
530 + region = iommu_alloc_resv_region(entry->address_start,
531 +- length, prot,
532 +- IOMMU_RESV_DIRECT);
533 ++ length, prot, type);
534 + if (!region) {
535 + pr_err("Out of memory allocating dm-regions for %s\n",
536 + dev_name(dev));
537 +diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
538 +index e062ab9687c7..be3801d43d48 100644
539 +--- a/drivers/iommu/amd_iommu_init.c
540 ++++ b/drivers/iommu/amd_iommu_init.c
541 +@@ -2001,6 +2001,9 @@ static int __init init_unity_map_range(struct ivmd_header *m)
542 + if (e == NULL)
543 + return -ENOMEM;
544 +
545 ++ if (m->flags & IVMD_FLAG_EXCL_RANGE)
546 ++ init_exclusion_range(m);
547 ++
548 + switch (m->type) {
549 + default:
550 + kfree(e);
551 +@@ -2047,9 +2050,7 @@ static int __init init_memory_definitions(struct acpi_table_header *table)
552 +
553 + while (p < end) {
554 + m = (struct ivmd_header *)p;
555 +- if (m->flags & IVMD_FLAG_EXCL_RANGE)
556 +- init_exclusion_range(m);
557 +- else if (m->flags & IVMD_FLAG_UNITY_MAP)
558 ++ if (m->flags & (IVMD_FLAG_UNITY_MAP | IVMD_FLAG_EXCL_RANGE))
559 + init_unity_map_range(m);
560 +
561 + p += m->length;
562 +diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h
563 +index e2b342e65a7b..69f3d4c95b53 100644
564 +--- a/drivers/iommu/amd_iommu_types.h
565 ++++ b/drivers/iommu/amd_iommu_types.h
566 +@@ -373,6 +373,8 @@
567 + #define IOMMU_PROT_IR 0x01
568 + #define IOMMU_PROT_IW 0x02
569 +
570 ++#define IOMMU_UNITY_MAP_FLAG_EXCL_RANGE (1 << 2)
571 ++
572 + /* IOMMU capabilities */
573 + #define IOMMU_CAP_IOTLB 24
574 + #define IOMMU_CAP_NPCACHE 26
575 +diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c
576 +index 7fea18b0c15d..7cb4d685a1f1 100644
577 +--- a/drivers/leds/leds-pca9532.c
578 ++++ b/drivers/leds/leds-pca9532.c
579 +@@ -513,6 +513,7 @@ static int pca9532_probe(struct i2c_client *client,
580 + const struct i2c_device_id *id)
581 + {
582 + int devid;
583 ++ const struct of_device_id *of_id;
584 + struct pca9532_data *data = i2c_get_clientdata(client);
585 + struct pca9532_platform_data *pca9532_pdata =
586 + dev_get_platdata(&client->dev);
587 +@@ -528,8 +529,11 @@ static int pca9532_probe(struct i2c_client *client,
588 + dev_err(&client->dev, "no platform data\n");
589 + return -EINVAL;
590 + }
591 +- devid = (int)(uintptr_t)of_match_device(
592 +- of_pca9532_leds_match, &client->dev)->data;
593 ++ of_id = of_match_device(of_pca9532_leds_match,
594 ++ &client->dev);
595 ++ if (unlikely(!of_id))
596 ++ return -EINVAL;
597 ++ devid = (int)(uintptr_t) of_id->data;
598 + } else {
599 + devid = id->driver_data;
600 + }
601 +diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c
602 +index 3dd3ed46d473..136f86a1627d 100644
603 +--- a/drivers/leds/trigger/ledtrig-netdev.c
604 ++++ b/drivers/leds/trigger/ledtrig-netdev.c
605 +@@ -122,7 +122,8 @@ static ssize_t device_name_store(struct device *dev,
606 + trigger_data->net_dev = NULL;
607 + }
608 +
609 +- strncpy(trigger_data->device_name, buf, size);
610 ++ memcpy(trigger_data->device_name, buf, size);
611 ++ trigger_data->device_name[size] = 0;
612 + if (size > 0 && trigger_data->device_name[size - 1] == '\n')
613 + trigger_data->device_name[size - 1] = 0;
614 +
615 +@@ -301,11 +302,11 @@ static int netdev_trig_notify(struct notifier_block *nb,
616 + container_of(nb, struct led_netdev_data, notifier);
617 +
618 + if (evt != NETDEV_UP && evt != NETDEV_DOWN && evt != NETDEV_CHANGE
619 +- && evt != NETDEV_REGISTER && evt != NETDEV_UNREGISTER
620 +- && evt != NETDEV_CHANGENAME)
621 ++ && evt != NETDEV_REGISTER && evt != NETDEV_UNREGISTER)
622 + return NOTIFY_DONE;
623 +
624 +- if (strcmp(dev->name, trigger_data->device_name))
625 ++ if (!(dev == trigger_data->net_dev ||
626 ++ (evt == NETDEV_REGISTER && !strcmp(dev->name, trigger_data->device_name))))
627 + return NOTIFY_DONE;
628 +
629 + cancel_delayed_work_sync(&trigger_data->work);
630 +@@ -320,12 +321,9 @@ static int netdev_trig_notify(struct notifier_block *nb,
631 + dev_hold(dev);
632 + trigger_data->net_dev = dev;
633 + break;
634 +- case NETDEV_CHANGENAME:
635 + case NETDEV_UNREGISTER:
636 +- if (trigger_data->net_dev) {
637 +- dev_put(trigger_data->net_dev);
638 +- trigger_data->net_dev = NULL;
639 +- }
640 ++ dev_put(trigger_data->net_dev);
641 ++ trigger_data->net_dev = NULL;
642 + break;
643 + case NETDEV_UP:
644 + case NETDEV_CHANGE:
645 +diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
646 +index 8abea1c3844f..7d7b51383adf 100644
647 +--- a/drivers/net/ethernet/cadence/macb_main.c
648 ++++ b/drivers/net/ethernet/cadence/macb_main.c
649 +@@ -3323,14 +3323,20 @@ static int macb_clk_init(struct platform_device *pdev, struct clk **pclk,
650 + *hclk = devm_clk_get(&pdev->dev, "hclk");
651 + }
652 +
653 +- if (IS_ERR(*pclk)) {
654 ++ if (IS_ERR_OR_NULL(*pclk)) {
655 + err = PTR_ERR(*pclk);
656 ++ if (!err)
657 ++ err = -ENODEV;
658 ++
659 + dev_err(&pdev->dev, "failed to get macb_clk (%u)\n", err);
660 + return err;
661 + }
662 +
663 +- if (IS_ERR(*hclk)) {
664 ++ if (IS_ERR_OR_NULL(*hclk)) {
665 + err = PTR_ERR(*hclk);
666 ++ if (!err)
667 ++ err = -ENODEV;
668 ++
669 + dev_err(&pdev->dev, "failed to get hclk (%u)\n", err);
670 + return err;
671 + }
672 +diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
673 +index 03f64f40b2a3..506f78322d74 100644
674 +--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
675 ++++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
676 +@@ -3161,6 +3161,7 @@ static ssize_t ehea_probe_port(struct device *dev,
677 +
678 + if (ehea_add_adapter_mr(adapter)) {
679 + pr_err("creating MR failed\n");
680 ++ of_node_put(eth_dn);
681 + return -EIO;
682 + }
683 +
684 +diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
685 +index bd6e9014bc74..b83b070a9eec 100644
686 +--- a/drivers/net/ethernet/micrel/ks8851.c
687 ++++ b/drivers/net/ethernet/micrel/ks8851.c
688 +@@ -535,9 +535,8 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
689 + /* set dma read address */
690 + ks8851_wrreg16(ks, KS_RXFDPR, RXFDPR_RXFPAI | 0x00);
691 +
692 +- /* start the packet dma process, and set auto-dequeue rx */
693 +- ks8851_wrreg16(ks, KS_RXQCR,
694 +- ks->rc_rxqcr | RXQCR_SDA | RXQCR_ADRFE);
695 ++ /* start DMA access */
696 ++ ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr | RXQCR_SDA);
697 +
698 + if (rxlen > 4) {
699 + unsigned int rxalign;
700 +@@ -568,7 +567,8 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
701 + }
702 + }
703 +
704 +- ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr);
705 ++ /* end DMA access and dequeue packet */
706 ++ ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr | RXQCR_RRXEF);
707 + }
708 + }
709 +
710 +@@ -785,6 +785,15 @@ static void ks8851_tx_work(struct work_struct *work)
711 + static int ks8851_net_open(struct net_device *dev)
712 + {
713 + struct ks8851_net *ks = netdev_priv(dev);
714 ++ int ret;
715 ++
716 ++ ret = request_threaded_irq(dev->irq, NULL, ks8851_irq,
717 ++ IRQF_TRIGGER_LOW | IRQF_ONESHOT,
718 ++ dev->name, ks);
719 ++ if (ret < 0) {
720 ++ netdev_err(dev, "failed to get irq\n");
721 ++ return ret;
722 ++ }
723 +
724 + /* lock the card, even if we may not actually be doing anything
725 + * else at the moment */
726 +@@ -849,6 +858,7 @@ static int ks8851_net_open(struct net_device *dev)
727 + netif_dbg(ks, ifup, ks->netdev, "network device up\n");
728 +
729 + mutex_unlock(&ks->lock);
730 ++ mii_check_link(&ks->mii);
731 + return 0;
732 + }
733 +
734 +@@ -899,6 +909,8 @@ static int ks8851_net_stop(struct net_device *dev)
735 + dev_kfree_skb(txb);
736 + }
737 +
738 ++ free_irq(dev->irq, ks);
739 ++
740 + return 0;
741 + }
742 +
743 +@@ -1508,6 +1520,7 @@ static int ks8851_probe(struct spi_device *spi)
744 +
745 + spi_set_drvdata(spi, ks);
746 +
747 ++ netif_carrier_off(ks->netdev);
748 + ndev->if_port = IF_PORT_100BASET;
749 + ndev->netdev_ops = &ks8851_netdev_ops;
750 + ndev->irq = spi->irq;
751 +@@ -1529,14 +1542,6 @@ static int ks8851_probe(struct spi_device *spi)
752 + ks8851_read_selftest(ks);
753 + ks8851_init_mac(ks);
754 +
755 +- ret = request_threaded_irq(spi->irq, NULL, ks8851_irq,
756 +- IRQF_TRIGGER_LOW | IRQF_ONESHOT,
757 +- ndev->name, ks);
758 +- if (ret < 0) {
759 +- dev_err(&spi->dev, "failed to get irq\n");
760 +- goto err_irq;
761 +- }
762 +-
763 + ret = register_netdev(ndev);
764 + if (ret) {
765 + dev_err(&spi->dev, "failed to register network device\n");
766 +@@ -1549,14 +1554,10 @@ static int ks8851_probe(struct spi_device *spi)
767 +
768 + return 0;
769 +
770 +-
771 + err_netdev:
772 +- free_irq(ndev->irq, ks);
773 +-
774 +-err_irq:
775 ++err_id:
776 + if (gpio_is_valid(gpio))
777 + gpio_set_value(gpio, 0);
778 +-err_id:
779 + regulator_disable(ks->vdd_reg);
780 + err_reg:
781 + regulator_disable(ks->vdd_io);
782 +@@ -1574,7 +1575,6 @@ static int ks8851_remove(struct spi_device *spi)
783 + dev_info(&spi->dev, "remove\n");
784 +
785 + unregister_netdev(priv->netdev);
786 +- free_irq(spi->irq, priv);
787 + if (gpio_is_valid(priv->gpio))
788 + gpio_set_value(priv->gpio, 0);
789 + regulator_disable(priv->vdd_reg);
790 +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
791 +index 3b0adda7cc9c..a4cd6f2cfb86 100644
792 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
793 ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
794 +@@ -1048,6 +1048,8 @@ int qlcnic_do_lb_test(struct qlcnic_adapter *adapter, u8 mode)
795 +
796 + for (i = 0; i < QLCNIC_NUM_ILB_PKT; i++) {
797 + skb = netdev_alloc_skb(adapter->netdev, QLCNIC_ILB_PKT_SIZE);
798 ++ if (!skb)
799 ++ break;
800 + qlcnic_create_loopback_buff(skb->data, adapter->mac_addr);
801 + skb_put(skb, QLCNIC_ILB_PKT_SIZE);
802 + adapter->ahw->diag_cnt = 0;
803 +diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
804 +index 62460a5b4ad9..39c105092214 100644
805 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
806 ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
807 +@@ -3195,14 +3195,16 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
808 + stmmac_prepare_tx_desc(priv, first, 1, nopaged_len,
809 + csum_insertion, priv->mode, 1, last_segment,
810 + skb->len);
811 +-
812 +- /* The own bit must be the latest setting done when prepare the
813 +- * descriptor and then barrier is needed to make sure that
814 +- * all is coherent before granting the DMA engine.
815 +- */
816 +- wmb();
817 ++ } else {
818 ++ stmmac_set_tx_owner(priv, first);
819 + }
820 +
821 ++ /* The own bit must be the latest setting done when prepare the
822 ++ * descriptor and then barrier is needed to make sure that
823 ++ * all is coherent before granting the DMA engine.
824 ++ */
825 ++ wmb();
826 ++
827 + netdev_tx_sent_queue(netdev_get_tx_queue(dev, queue), skb->len);
828 +
829 + stmmac_enable_dma_transmission(priv, priv->ioaddr);
830 +diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
831 +index 72b98e27c992..d177dfd1df89 100644
832 +--- a/drivers/net/ethernet/ti/netcp_ethss.c
833 ++++ b/drivers/net/ethernet/ti/netcp_ethss.c
834 +@@ -3655,12 +3655,16 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
835 +
836 + ret = netcp_txpipe_init(&gbe_dev->tx_pipe, netcp_device,
837 + gbe_dev->dma_chan_name, gbe_dev->tx_queue_id);
838 +- if (ret)
839 ++ if (ret) {
840 ++ of_node_put(interfaces);
841 + return ret;
842 ++ }
843 +
844 + ret = netcp_txpipe_open(&gbe_dev->tx_pipe);
845 +- if (ret)
846 ++ if (ret) {
847 ++ of_node_put(interfaces);
848 + return ret;
849 ++ }
850 +
851 + /* Create network interfaces */
852 + INIT_LIST_HEAD(&gbe_dev->gbe_intf_head);
853 +diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
854 +index f24f48f33802..7cfd7ff38e86 100644
855 +--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
856 ++++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
857 +@@ -1574,12 +1574,14 @@ static int axienet_probe(struct platform_device *pdev)
858 + ret = of_address_to_resource(np, 0, &dmares);
859 + if (ret) {
860 + dev_err(&pdev->dev, "unable to get DMA resource\n");
861 ++ of_node_put(np);
862 + goto free_netdev;
863 + }
864 + lp->dma_regs = devm_ioremap_resource(&pdev->dev, &dmares);
865 + if (IS_ERR(lp->dma_regs)) {
866 + dev_err(&pdev->dev, "could not map DMA regs\n");
867 + ret = PTR_ERR(lp->dma_regs);
868 ++ of_node_put(np);
869 + goto free_netdev;
870 + }
871 + lp->rx_irq = irq_of_parse_and_map(np, 1);
872 +diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c
873 +index cd1d8faccca5..cd6b95e673a5 100644
874 +--- a/drivers/net/ieee802154/adf7242.c
875 ++++ b/drivers/net/ieee802154/adf7242.c
876 +@@ -1268,6 +1268,10 @@ static int adf7242_probe(struct spi_device *spi)
877 + INIT_DELAYED_WORK(&lp->work, adf7242_rx_cal_work);
878 + lp->wqueue = alloc_ordered_workqueue(dev_name(&spi->dev),
879 + WQ_MEM_RECLAIM);
880 ++ if (unlikely(!lp->wqueue)) {
881 ++ ret = -ENOMEM;
882 ++ goto err_hw_init;
883 ++ }
884 +
885 + ret = adf7242_hw_init(lp);
886 + if (ret)
887 +diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c
888 +index 624bff4d3636..f1ed1744801c 100644
889 +--- a/drivers/net/ieee802154/mac802154_hwsim.c
890 ++++ b/drivers/net/ieee802154/mac802154_hwsim.c
891 +@@ -332,7 +332,7 @@ static int hwsim_get_radio_nl(struct sk_buff *msg, struct genl_info *info)
892 + goto out_err;
893 + }
894 +
895 +- genlmsg_reply(skb, info);
896 ++ res = genlmsg_reply(skb, info);
897 + break;
898 + }
899 +
900 +diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
901 +index da8f5ad30c71..260248fbb8fe 100644
902 +--- a/drivers/nvme/host/multipath.c
903 ++++ b/drivers/nvme/host/multipath.c
904 +@@ -349,15 +349,12 @@ static inline bool nvme_state_is_live(enum nvme_ana_state state)
905 + static void nvme_update_ns_ana_state(struct nvme_ana_group_desc *desc,
906 + struct nvme_ns *ns)
907 + {
908 +- enum nvme_ana_state old;
909 +-
910 + mutex_lock(&ns->head->lock);
911 +- old = ns->ana_state;
912 + ns->ana_grpid = le32_to_cpu(desc->grpid);
913 + ns->ana_state = desc->state;
914 + clear_bit(NVME_NS_ANA_PENDING, &ns->flags);
915 +
916 +- if (nvme_state_is_live(ns->ana_state) && !nvme_state_is_live(old))
917 ++ if (nvme_state_is_live(ns->ana_state))
918 + nvme_mpath_set_live(ns);
919 + mutex_unlock(&ns->head->lock);
920 + }
921 +diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
922 +index 7f71ca0d08e7..9c5e801b3f6c 100644
923 +--- a/drivers/s390/net/qeth_l3_main.c
924 ++++ b/drivers/s390/net/qeth_l3_main.c
925 +@@ -2586,12 +2586,14 @@ static int qeth_l3_probe_device(struct ccwgroup_device *gdev)
926 + struct qeth_card *card = dev_get_drvdata(&gdev->dev);
927 + int rc;
928 +
929 ++ hash_init(card->ip_htable);
930 ++
931 + if (gdev->dev.type == &qeth_generic_devtype) {
932 + rc = qeth_l3_create_device_attributes(&gdev->dev);
933 + if (rc)
934 + return rc;
935 + }
936 +- hash_init(card->ip_htable);
937 ++
938 + hash_init(card->ip_mc_htable);
939 + card->options.layer2 = 0;
940 + card->info.hwtrap = 0;
941 +diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c
942 +index f6c415d6ef48..5eb7aabe2d8b 100644
943 +--- a/drivers/s390/scsi/zfcp_fc.c
944 ++++ b/drivers/s390/scsi/zfcp_fc.c
945 +@@ -239,10 +239,6 @@ static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range,
946 + list_for_each_entry(port, &adapter->port_list, list) {
947 + if ((port->d_id & range) == (ntoh24(page->rscn_fid) & range))
948 + zfcp_fc_test_link(port);
949 +- if (!port->d_id)
950 +- zfcp_erp_port_reopen(port,
951 +- ZFCP_STATUS_COMMON_ERP_FAILED,
952 +- "fcrscn1");
953 + }
954 + read_unlock_irqrestore(&adapter->port_list_lock, flags);
955 + }
956 +@@ -250,6 +246,7 @@ static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range,
957 + static void zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req)
958 + {
959 + struct fsf_status_read_buffer *status_buffer = (void *)fsf_req->data;
960 ++ struct zfcp_adapter *adapter = fsf_req->adapter;
961 + struct fc_els_rscn *head;
962 + struct fc_els_rscn_page *page;
963 + u16 i;
964 +@@ -263,6 +260,22 @@ static void zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req)
965 + no_entries = be16_to_cpu(head->rscn_plen) /
966 + sizeof(struct fc_els_rscn_page);
967 +
968 ++ if (no_entries > 1) {
969 ++ /* handle failed ports */
970 ++ unsigned long flags;
971 ++ struct zfcp_port *port;
972 ++
973 ++ read_lock_irqsave(&adapter->port_list_lock, flags);
974 ++ list_for_each_entry(port, &adapter->port_list, list) {
975 ++ if (port->d_id)
976 ++ continue;
977 ++ zfcp_erp_port_reopen(port,
978 ++ ZFCP_STATUS_COMMON_ERP_FAILED,
979 ++ "fcrscn1");
980 ++ }
981 ++ read_unlock_irqrestore(&adapter->port_list_lock, flags);
982 ++ }
983 ++
984 + for (i = 1; i < no_entries; i++) {
985 + /* skip head and start with 1st element */
986 + page++;
987 +diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
988 +index 39eb415987fc..074760f21014 100644
989 +--- a/drivers/scsi/aacraid/aacraid.h
990 ++++ b/drivers/scsi/aacraid/aacraid.h
991 +@@ -2639,9 +2639,14 @@ static inline unsigned int cap_to_cyls(sector_t capacity, unsigned divisor)
992 + return capacity;
993 + }
994 +
995 ++static inline int aac_pci_offline(struct aac_dev *dev)
996 ++{
997 ++ return pci_channel_offline(dev->pdev) || dev->handle_pci_error;
998 ++}
999 ++
1000 + static inline int aac_adapter_check_health(struct aac_dev *dev)
1001 + {
1002 +- if (unlikely(pci_channel_offline(dev->pdev)))
1003 ++ if (unlikely(aac_pci_offline(dev)))
1004 + return -1;
1005 +
1006 + return (dev)->a_ops.adapter_check_health(dev);
1007 +diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
1008 +index 3236240a4edd..b7588de4484e 100644
1009 +--- a/drivers/scsi/aacraid/commsup.c
1010 ++++ b/drivers/scsi/aacraid/commsup.c
1011 +@@ -673,7 +673,7 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
1012 + return -ETIMEDOUT;
1013 + }
1014 +
1015 +- if (unlikely(pci_channel_offline(dev->pdev)))
1016 ++ if (unlikely(aac_pci_offline(dev)))
1017 + return -EFAULT;
1018 +
1019 + if ((blink = aac_adapter_check_health(dev)) > 0) {
1020 +@@ -773,7 +773,7 @@ int aac_hba_send(u8 command, struct fib *fibptr, fib_callback callback,
1021 +
1022 + spin_unlock_irqrestore(&fibptr->event_lock, flags);
1023 +
1024 +- if (unlikely(pci_channel_offline(dev->pdev)))
1025 ++ if (unlikely(aac_pci_offline(dev)))
1026 + return -EFAULT;
1027 +
1028 + fibptr->flags |= FIB_CONTEXT_FLAG_WAIT;
1029 +diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
1030 +index b59bba3e6516..8776330175e3 100644
1031 +--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
1032 ++++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
1033 +@@ -3280,12 +3280,18 @@ mpt3sas_base_free_smid(struct MPT3SAS_ADAPTER *ioc, u16 smid)
1034 +
1035 + if (smid < ioc->hi_priority_smid) {
1036 + struct scsiio_tracker *st;
1037 ++ void *request;
1038 +
1039 + st = _get_st_from_smid(ioc, smid);
1040 + if (!st) {
1041 + _base_recovery_check(ioc);
1042 + return;
1043 + }
1044 ++
1045 ++ /* Clear MPI request frame */
1046 ++ request = mpt3sas_base_get_msg_frame(ioc, smid);
1047 ++ memset(request, 0, ioc->request_sz);
1048 ++
1049 + mpt3sas_base_clear_st(ioc, st);
1050 + _base_recovery_check(ioc);
1051 + return;
1052 +diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
1053 +index 622832e55211..73d661a0ecbb 100644
1054 +--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
1055 ++++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
1056 +@@ -1474,11 +1474,23 @@ mpt3sas_scsih_scsi_lookup_get(struct MPT3SAS_ADAPTER *ioc, u16 smid)
1057 + {
1058 + struct scsi_cmnd *scmd = NULL;
1059 + struct scsiio_tracker *st;
1060 ++ Mpi25SCSIIORequest_t *mpi_request;
1061 +
1062 + if (smid > 0 &&
1063 + smid <= ioc->scsiio_depth - INTERNAL_SCSIIO_CMDS_COUNT) {
1064 + u32 unique_tag = smid - 1;
1065 +
1066 ++ mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
1067 ++
1068 ++ /*
1069 ++ * If SCSI IO request is outstanding at driver level then
1070 ++ * DevHandle filed must be non-zero. If DevHandle is zero
1071 ++ * then it means that this smid is free at driver level,
1072 ++ * so return NULL.
1073 ++ */
1074 ++ if (!mpi_request->DevHandle)
1075 ++ return scmd;
1076 ++
1077 + scmd = scsi_host_find_tag(ioc->shost, unique_tag);
1078 + if (scmd) {
1079 + st = scsi_cmd_priv(scmd);
1080 +diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
1081 +index 575445c761b4..5dd3e4e01b10 100644
1082 +--- a/drivers/scsi/qla4xxx/ql4_os.c
1083 ++++ b/drivers/scsi/qla4xxx/ql4_os.c
1084 +@@ -3204,6 +3204,8 @@ static int qla4xxx_conn_bind(struct iscsi_cls_session *cls_session,
1085 + if (iscsi_conn_bind(cls_session, cls_conn, is_leading))
1086 + return -EINVAL;
1087 + ep = iscsi_lookup_endpoint(transport_fd);
1088 ++ if (!ep)
1089 ++ return -EINVAL;
1090 + conn = cls_conn->dd_data;
1091 + qla_conn = conn->dd_data;
1092 + qla_conn->qla_ep = ep->dd_data;
1093 +diff --git a/drivers/staging/axis-fifo/Kconfig b/drivers/staging/axis-fifo/Kconfig
1094 +index 687537203d9c..d9725888af6f 100644
1095 +--- a/drivers/staging/axis-fifo/Kconfig
1096 ++++ b/drivers/staging/axis-fifo/Kconfig
1097 +@@ -3,6 +3,7 @@
1098 + #
1099 + config XIL_AXIS_FIFO
1100 + tristate "Xilinx AXI-Stream FIFO IP core driver"
1101 ++ depends on OF
1102 + default n
1103 + help
1104 + This adds support for the Xilinx AXI-Stream
1105 +diff --git a/drivers/staging/mt7621-pci/Kconfig b/drivers/staging/mt7621-pci/Kconfig
1106 +index d33533872a16..c8fa17cfa807 100644
1107 +--- a/drivers/staging/mt7621-pci/Kconfig
1108 ++++ b/drivers/staging/mt7621-pci/Kconfig
1109 +@@ -1,6 +1,7 @@
1110 + config PCI_MT7621
1111 + tristate "MediaTek MT7621 PCI Controller"
1112 + depends on RALINK
1113 ++ depends on PCI
1114 + select PCI_DRIVERS_GENERIC
1115 + help
1116 + This selects a driver for the MediaTek MT7621 PCI Controller.
1117 +diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c
1118 +index 2130d78e0d9f..dd9b02d316f3 100644
1119 +--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
1120 ++++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
1121 +@@ -178,7 +178,9 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
1122 +
1123 + pxmitpriv->free_xmit_extbuf_cnt = num_xmit_extbuf;
1124 +
1125 +- rtw_alloc_hwxmits(padapter);
1126 ++ res = rtw_alloc_hwxmits(padapter);
1127 ++ if (res == _FAIL)
1128 ++ goto exit;
1129 + rtw_init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry);
1130 +
1131 + for (i = 0; i < 4; i++)
1132 +@@ -1502,7 +1504,7 @@ exit:
1133 + return res;
1134 + }
1135 +
1136 +-void rtw_alloc_hwxmits(struct adapter *padapter)
1137 ++s32 rtw_alloc_hwxmits(struct adapter *padapter)
1138 + {
1139 + struct hw_xmit *hwxmits;
1140 + struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
1141 +@@ -1511,6 +1513,8 @@ void rtw_alloc_hwxmits(struct adapter *padapter)
1142 +
1143 + pxmitpriv->hwxmits = kcalloc(pxmitpriv->hwxmit_entry,
1144 + sizeof(struct hw_xmit), GFP_KERNEL);
1145 ++ if (!pxmitpriv->hwxmits)
1146 ++ return _FAIL;
1147 +
1148 + hwxmits = pxmitpriv->hwxmits;
1149 +
1150 +@@ -1518,6 +1522,7 @@ void rtw_alloc_hwxmits(struct adapter *padapter)
1151 + hwxmits[1] .sta_queue = &pxmitpriv->vi_pending;
1152 + hwxmits[2] .sta_queue = &pxmitpriv->be_pending;
1153 + hwxmits[3] .sta_queue = &pxmitpriv->bk_pending;
1154 ++ return _SUCCESS;
1155 + }
1156 +
1157 + void rtw_free_hwxmits(struct adapter *padapter)
1158 +diff --git a/drivers/staging/rtl8188eu/include/rtw_xmit.h b/drivers/staging/rtl8188eu/include/rtw_xmit.h
1159 +index 788f59c74ea1..ba7e15fbde72 100644
1160 +--- a/drivers/staging/rtl8188eu/include/rtw_xmit.h
1161 ++++ b/drivers/staging/rtl8188eu/include/rtw_xmit.h
1162 +@@ -336,7 +336,7 @@ s32 rtw_txframes_sta_ac_pending(struct adapter *padapter,
1163 + void rtw_init_hwxmits(struct hw_xmit *phwxmit, int entry);
1164 + s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter);
1165 + void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv);
1166 +-void rtw_alloc_hwxmits(struct adapter *padapter);
1167 ++s32 rtw_alloc_hwxmits(struct adapter *padapter);
1168 + void rtw_free_hwxmits(struct adapter *padapter);
1169 + s32 rtw_xmit(struct adapter *padapter, struct sk_buff **pkt);
1170 +
1171 +diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c b/drivers/staging/rtl8712/rtl8712_cmd.c
1172 +index b1dfe9f46619..63bc811681d9 100644
1173 +--- a/drivers/staging/rtl8712/rtl8712_cmd.c
1174 ++++ b/drivers/staging/rtl8712/rtl8712_cmd.c
1175 +@@ -159,17 +159,9 @@ static u8 write_macreg_hdl(struct _adapter *padapter, u8 *pbuf)
1176 +
1177 + static u8 read_bbreg_hdl(struct _adapter *padapter, u8 *pbuf)
1178 + {
1179 +- u32 val;
1180 +- void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
1181 + struct cmd_obj *pcmd = (struct cmd_obj *)pbuf;
1182 +
1183 +- if (pcmd->rsp && pcmd->rspsz > 0)
1184 +- memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
1185 +- pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
1186 +- if (!pcmd_callback)
1187 +- r8712_free_cmd_obj(pcmd);
1188 +- else
1189 +- pcmd_callback(padapter, pcmd);
1190 ++ r8712_free_cmd_obj(pcmd);
1191 + return H2C_SUCCESS;
1192 + }
1193 +
1194 +diff --git a/drivers/staging/rtl8712/rtl8712_cmd.h b/drivers/staging/rtl8712/rtl8712_cmd.h
1195 +index 9181bb6b04c3..a101a0a50955 100644
1196 +--- a/drivers/staging/rtl8712/rtl8712_cmd.h
1197 ++++ b/drivers/staging/rtl8712/rtl8712_cmd.h
1198 +@@ -152,7 +152,7 @@ enum rtl8712_h2c_cmd {
1199 + static struct _cmd_callback cmd_callback[] = {
1200 + {GEN_CMD_CODE(_Read_MACREG), NULL}, /*0*/
1201 + {GEN_CMD_CODE(_Write_MACREG), NULL},
1202 +- {GEN_CMD_CODE(_Read_BBREG), &r8712_getbbrfreg_cmdrsp_callback},
1203 ++ {GEN_CMD_CODE(_Read_BBREG), NULL},
1204 + {GEN_CMD_CODE(_Write_BBREG), NULL},
1205 + {GEN_CMD_CODE(_Read_RFREG), &r8712_getbbrfreg_cmdrsp_callback},
1206 + {GEN_CMD_CODE(_Write_RFREG), NULL}, /*5*/
1207 +diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
1208 +index edb678190b4b..16291de5c0d9 100644
1209 +--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
1210 ++++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
1211 +@@ -260,7 +260,9 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
1212 + }
1213 + }
1214 +
1215 +- rtw_alloc_hwxmits(padapter);
1216 ++ res = rtw_alloc_hwxmits(padapter);
1217 ++ if (res == _FAIL)
1218 ++ goto exit;
1219 + rtw_init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry);
1220 +
1221 + for (i = 0; i < 4; i++) {
1222 +@@ -2144,7 +2146,7 @@ exit:
1223 + return res;
1224 + }
1225 +
1226 +-void rtw_alloc_hwxmits(struct adapter *padapter)
1227 ++s32 rtw_alloc_hwxmits(struct adapter *padapter)
1228 + {
1229 + struct hw_xmit *hwxmits;
1230 + struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
1231 +@@ -2155,10 +2157,8 @@ void rtw_alloc_hwxmits(struct adapter *padapter)
1232 +
1233 + pxmitpriv->hwxmits = rtw_zmalloc(sizeof(struct hw_xmit) * pxmitpriv->hwxmit_entry);
1234 +
1235 +- if (pxmitpriv->hwxmits == NULL) {
1236 +- DBG_871X("alloc hwxmits fail!...\n");
1237 +- return;
1238 +- }
1239 ++ if (!pxmitpriv->hwxmits)
1240 ++ return _FAIL;
1241 +
1242 + hwxmits = pxmitpriv->hwxmits;
1243 +
1244 +@@ -2204,7 +2204,7 @@ void rtw_alloc_hwxmits(struct adapter *padapter)
1245 +
1246 + }
1247 +
1248 +-
1249 ++ return _SUCCESS;
1250 + }
1251 +
1252 + void rtw_free_hwxmits(struct adapter *padapter)
1253 +diff --git a/drivers/staging/rtl8723bs/include/rtw_xmit.h b/drivers/staging/rtl8723bs/include/rtw_xmit.h
1254 +index a75b668d09a6..021c72361fbb 100644
1255 +--- a/drivers/staging/rtl8723bs/include/rtw_xmit.h
1256 ++++ b/drivers/staging/rtl8723bs/include/rtw_xmit.h
1257 +@@ -486,7 +486,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter);
1258 + void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv);
1259 +
1260 +
1261 +-void rtw_alloc_hwxmits(struct adapter *padapter);
1262 ++s32 rtw_alloc_hwxmits(struct adapter *padapter);
1263 + void rtw_free_hwxmits(struct adapter *padapter);
1264 +
1265 +
1266 +diff --git a/drivers/staging/rtlwifi/phydm/rtl_phydm.c b/drivers/staging/rtlwifi/phydm/rtl_phydm.c
1267 +index 9930ed954abb..4cc77b2016e1 100644
1268 +--- a/drivers/staging/rtlwifi/phydm/rtl_phydm.c
1269 ++++ b/drivers/staging/rtlwifi/phydm/rtl_phydm.c
1270 +@@ -180,6 +180,8 @@ static int rtl_phydm_init_priv(struct rtl_priv *rtlpriv,
1271 +
1272 + rtlpriv->phydm.internal =
1273 + kzalloc(sizeof(struct phy_dm_struct), GFP_KERNEL);
1274 ++ if (!rtlpriv->phydm.internal)
1275 ++ return 0;
1276 +
1277 + _rtl_phydm_init_com_info(rtlpriv, ic, params);
1278 +
1279 +diff --git a/drivers/staging/rtlwifi/rtl8822be/fw.c b/drivers/staging/rtlwifi/rtl8822be/fw.c
1280 +index a40396614814..c1ed52df05f0 100644
1281 +--- a/drivers/staging/rtlwifi/rtl8822be/fw.c
1282 ++++ b/drivers/staging/rtlwifi/rtl8822be/fw.c
1283 +@@ -741,6 +741,8 @@ void rtl8822be_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
1284 + u1_rsvd_page_loc, 3);
1285 +
1286 + skb = dev_alloc_skb(totalpacketlen);
1287 ++ if (!skb)
1288 ++ return;
1289 + memcpy((u8 *)skb_put(skb, totalpacketlen), &reserved_page_packet,
1290 + totalpacketlen);
1291 +
1292 +diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c
1293 +index db5df3d54818..3bdd56a1021b 100644
1294 +--- a/drivers/tty/serial/ar933x_uart.c
1295 ++++ b/drivers/tty/serial/ar933x_uart.c
1296 +@@ -49,11 +49,6 @@ struct ar933x_uart_port {
1297 + struct clk *clk;
1298 + };
1299 +
1300 +-static inline bool ar933x_uart_console_enabled(void)
1301 +-{
1302 +- return IS_ENABLED(CONFIG_SERIAL_AR933X_CONSOLE);
1303 +-}
1304 +-
1305 + static inline unsigned int ar933x_uart_read(struct ar933x_uart_port *up,
1306 + int offset)
1307 + {
1308 +@@ -508,6 +503,7 @@ static const struct uart_ops ar933x_uart_ops = {
1309 + .verify_port = ar933x_uart_verify_port,
1310 + };
1311 +
1312 ++#ifdef CONFIG_SERIAL_AR933X_CONSOLE
1313 + static struct ar933x_uart_port *
1314 + ar933x_console_ports[CONFIG_SERIAL_AR933X_NR_UARTS];
1315 +
1316 +@@ -604,14 +600,7 @@ static struct console ar933x_uart_console = {
1317 + .index = -1,
1318 + .data = &ar933x_uart_driver,
1319 + };
1320 +-
1321 +-static void ar933x_uart_add_console_port(struct ar933x_uart_port *up)
1322 +-{
1323 +- if (!ar933x_uart_console_enabled())
1324 +- return;
1325 +-
1326 +- ar933x_console_ports[up->port.line] = up;
1327 +-}
1328 ++#endif /* CONFIG_SERIAL_AR933X_CONSOLE */
1329 +
1330 + static struct uart_driver ar933x_uart_driver = {
1331 + .owner = THIS_MODULE,
1332 +@@ -700,7 +689,9 @@ static int ar933x_uart_probe(struct platform_device *pdev)
1333 + baud = ar933x_uart_get_baud(port->uartclk, 0, AR933X_UART_MAX_STEP);
1334 + up->max_baud = min_t(unsigned int, baud, AR933X_UART_MAX_BAUD);
1335 +
1336 +- ar933x_uart_add_console_port(up);
1337 ++#ifdef CONFIG_SERIAL_AR933X_CONSOLE
1338 ++ ar933x_console_ports[up->port.line] = up;
1339 ++#endif
1340 +
1341 + ret = uart_add_one_port(&ar933x_uart_driver, &up->port);
1342 + if (ret)
1343 +@@ -749,8 +740,9 @@ static int __init ar933x_uart_init(void)
1344 + {
1345 + int ret;
1346 +
1347 +- if (ar933x_uart_console_enabled())
1348 +- ar933x_uart_driver.cons = &ar933x_uart_console;
1349 ++#ifdef CONFIG_SERIAL_AR933X_CONSOLE
1350 ++ ar933x_uart_driver.cons = &ar933x_uart_console;
1351 ++#endif
1352 +
1353 + ret = uart_register_driver(&ar933x_uart_driver);
1354 + if (ret)
1355 +diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
1356 +index 47b41159a8bc..55b178c1bd65 100644
1357 +--- a/drivers/tty/serial/sc16is7xx.c
1358 ++++ b/drivers/tty/serial/sc16is7xx.c
1359 +@@ -1481,7 +1481,7 @@ static int __init sc16is7xx_init(void)
1360 + ret = i2c_add_driver(&sc16is7xx_i2c_uart_driver);
1361 + if (ret < 0) {
1362 + pr_err("failed to init sc16is7xx i2c --> %d\n", ret);
1363 +- return ret;
1364 ++ goto err_i2c;
1365 + }
1366 + #endif
1367 +
1368 +@@ -1489,10 +1489,18 @@ static int __init sc16is7xx_init(void)
1369 + ret = spi_register_driver(&sc16is7xx_spi_uart_driver);
1370 + if (ret < 0) {
1371 + pr_err("failed to init sc16is7xx spi --> %d\n", ret);
1372 +- return ret;
1373 ++ goto err_spi;
1374 + }
1375 + #endif
1376 + return ret;
1377 ++
1378 ++err_spi:
1379 ++#ifdef CONFIG_SERIAL_SC16IS7XX_I2C
1380 ++ i2c_del_driver(&sc16is7xx_i2c_uart_driver);
1381 ++#endif
1382 ++err_i2c:
1383 ++ uart_unregister_driver(&sc16is7xx_uart);
1384 ++ return ret;
1385 + }
1386 + module_init(sc16is7xx_init);
1387 +
1388 +diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
1389 +index fdc6e4e403e8..8cced3609e24 100644
1390 +--- a/drivers/usb/dwc3/dwc3-pci.c
1391 ++++ b/drivers/usb/dwc3/dwc3-pci.c
1392 +@@ -29,6 +29,7 @@
1393 + #define PCI_DEVICE_ID_INTEL_BXT_M 0x1aaa
1394 + #define PCI_DEVICE_ID_INTEL_APL 0x5aaa
1395 + #define PCI_DEVICE_ID_INTEL_KBP 0xa2b0
1396 ++#define PCI_DEVICE_ID_INTEL_CMLH 0x02ee
1397 + #define PCI_DEVICE_ID_INTEL_GLK 0x31aa
1398 + #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee
1399 + #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e
1400 +@@ -305,6 +306,9 @@ static const struct pci_device_id dwc3_pci_id_table[] = {
1401 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MRFLD),
1402 + (kernel_ulong_t) &dwc3_pci_mrfld_properties, },
1403 +
1404 ++ { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_CMLH),
1405 ++ (kernel_ulong_t) &dwc3_pci_intel_properties, },
1406 ++
1407 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_SPTLP),
1408 + (kernel_ulong_t) &dwc3_pci_intel_properties, },
1409 +
1410 +diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c
1411 +index b77f3126580e..c2011cd7df8c 100644
1412 +--- a/drivers/usb/gadget/udc/net2272.c
1413 ++++ b/drivers/usb/gadget/udc/net2272.c
1414 +@@ -945,6 +945,7 @@ net2272_dequeue(struct usb_ep *_ep, struct usb_request *_req)
1415 + break;
1416 + }
1417 + if (&req->req != _req) {
1418 ++ ep->stopped = stopped;
1419 + spin_unlock_irqrestore(&ep->dev->lock, flags);
1420 + return -EINVAL;
1421 + }
1422 +diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c
1423 +index b02ab2a8d927..ee872cad5270 100644
1424 +--- a/drivers/usb/gadget/udc/net2280.c
1425 ++++ b/drivers/usb/gadget/udc/net2280.c
1426 +@@ -866,9 +866,6 @@ static void start_queue(struct net2280_ep *ep, u32 dmactl, u32 td_dma)
1427 + (void) readl(&ep->dev->pci->pcimstctl);
1428 +
1429 + writel(BIT(DMA_START), &dma->dmastat);
1430 +-
1431 +- if (!ep->is_in)
1432 +- stop_out_naking(ep);
1433 + }
1434 +
1435 + static void start_dma(struct net2280_ep *ep, struct net2280_request *req)
1436 +@@ -907,6 +904,7 @@ static void start_dma(struct net2280_ep *ep, struct net2280_request *req)
1437 + writel(BIT(DMA_START), &dma->dmastat);
1438 + return;
1439 + }
1440 ++ stop_out_naking(ep);
1441 + }
1442 +
1443 + tmp = dmactl_default;
1444 +@@ -1275,9 +1273,9 @@ static int net2280_dequeue(struct usb_ep *_ep, struct usb_request *_req)
1445 + break;
1446 + }
1447 + if (&req->req != _req) {
1448 ++ ep->stopped = stopped;
1449 + spin_unlock_irqrestore(&ep->dev->lock, flags);
1450 +- dev_err(&ep->dev->pdev->dev, "%s: Request mismatch\n",
1451 +- __func__);
1452 ++ ep_dbg(ep->dev, "%s: Request mismatch\n", __func__);
1453 + return -EINVAL;
1454 + }
1455 +
1456 +diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
1457 +index 5b8a3d9530c4..5cac83aaeac3 100644
1458 +--- a/drivers/usb/host/u132-hcd.c
1459 ++++ b/drivers/usb/host/u132-hcd.c
1460 +@@ -3202,6 +3202,9 @@ static int __init u132_hcd_init(void)
1461 + printk(KERN_INFO "driver %s\n", hcd_name);
1462 + workqueue = create_singlethread_workqueue("u132");
1463 + retval = platform_driver_register(&u132_platform_driver);
1464 ++ if (retval)
1465 ++ destroy_workqueue(workqueue);
1466 ++
1467 + return retval;
1468 + }
1469 +
1470 +diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c
1471 +index a6efb9a72939..5f7734c729b1 100644
1472 +--- a/drivers/usb/misc/usb251xb.c
1473 ++++ b/drivers/usb/misc/usb251xb.c
1474 +@@ -601,7 +601,7 @@ static int usb251xb_probe(struct usb251xb *hub)
1475 + dev);
1476 + int err;
1477 +
1478 +- if (np) {
1479 ++ if (np && of_id) {
1480 + err = usb251xb_get_ofdata(hub,
1481 + (struct usb251xb_data *)of_id->data);
1482 + if (err) {
1483 +diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
1484 +index 4055ab4d5c52..3e518c2ae2bf 100644
1485 +--- a/fs/ceph/inode.c
1486 ++++ b/fs/ceph/inode.c
1487 +@@ -524,6 +524,7 @@ static void ceph_i_callback(struct rcu_head *head)
1488 + struct inode *inode = container_of(head, struct inode, i_rcu);
1489 + struct ceph_inode_info *ci = ceph_inode(inode);
1490 +
1491 ++ kfree(ci->i_symlink);
1492 + kmem_cache_free(ceph_inode_cachep, ci);
1493 + }
1494 +
1495 +@@ -561,7 +562,6 @@ void ceph_destroy_inode(struct inode *inode)
1496 + ceph_put_snap_realm(mdsc, realm);
1497 + }
1498 +
1499 +- kfree(ci->i_symlink);
1500 + while ((n = rb_first(&ci->i_fragtree)) != NULL) {
1501 + frag = rb_entry(n, struct ceph_inode_frag, node);
1502 + rb_erase(n, &ci->i_fragtree);
1503 +diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
1504 +index baaed4d05b22..249de20f752a 100644
1505 +--- a/fs/fuse/dev.c
1506 ++++ b/fs/fuse/dev.c
1507 +@@ -1989,10 +1989,8 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe,
1508 + rem += pipe->bufs[(pipe->curbuf + idx) & (pipe->buffers - 1)].len;
1509 +
1510 + ret = -EINVAL;
1511 +- if (rem < len) {
1512 +- pipe_unlock(pipe);
1513 +- goto out;
1514 +- }
1515 ++ if (rem < len)
1516 ++ goto out_free;
1517 +
1518 + rem = len;
1519 + while (rem) {
1520 +@@ -2010,7 +2008,9 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe,
1521 + pipe->curbuf = (pipe->curbuf + 1) & (pipe->buffers - 1);
1522 + pipe->nrbufs--;
1523 + } else {
1524 +- pipe_buf_get(pipe, ibuf);
1525 ++ if (!pipe_buf_get(pipe, ibuf))
1526 ++ goto out_free;
1527 ++
1528 + *obuf = *ibuf;
1529 + obuf->flags &= ~PIPE_BUF_FLAG_GIFT;
1530 + obuf->len = rem;
1531 +@@ -2033,11 +2033,11 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe,
1532 + ret = fuse_dev_do_write(fud, &cs, len);
1533 +
1534 + pipe_lock(pipe);
1535 ++out_free:
1536 + for (idx = 0; idx < nbuf; idx++)
1537 + pipe_buf_release(pipe, &bufs[idx]);
1538 + pipe_unlock(pipe);
1539 +
1540 +-out:
1541 + kvfree(bufs);
1542 + return ret;
1543 + }
1544 +diff --git a/fs/nfs/client.c b/fs/nfs/client.c
1545 +index 96d5f8135eb9..751ca65da8a3 100644
1546 +--- a/fs/nfs/client.c
1547 ++++ b/fs/nfs/client.c
1548 +@@ -459,7 +459,7 @@ void nfs_init_timeout_values(struct rpc_timeout *to, int proto,
1549 + case XPRT_TRANSPORT_RDMA:
1550 + if (retrans == NFS_UNSPEC_RETRANS)
1551 + to->to_retries = NFS_DEF_TCP_RETRANS;
1552 +- if (timeo == NFS_UNSPEC_TIMEO || to->to_retries == 0)
1553 ++ if (timeo == NFS_UNSPEC_TIMEO || to->to_initval == 0)
1554 + to->to_initval = NFS_DEF_TCP_TIMEO * HZ / 10;
1555 + if (to->to_initval > NFS_MAX_TCP_TIMEOUT)
1556 + to->to_initval = NFS_MAX_TCP_TIMEOUT;
1557 +diff --git a/fs/pipe.c b/fs/pipe.c
1558 +index c51750ed4011..2a297bce381f 100644
1559 +--- a/fs/pipe.c
1560 ++++ b/fs/pipe.c
1561 +@@ -189,9 +189,9 @@ EXPORT_SYMBOL(generic_pipe_buf_steal);
1562 + * in the tee() system call, when we duplicate the buffers in one
1563 + * pipe into another.
1564 + */
1565 +-void generic_pipe_buf_get(struct pipe_inode_info *pipe, struct pipe_buffer *buf)
1566 ++bool generic_pipe_buf_get(struct pipe_inode_info *pipe, struct pipe_buffer *buf)
1567 + {
1568 +- get_page(buf->page);
1569 ++ return try_get_page(buf->page);
1570 + }
1571 + EXPORT_SYMBOL(generic_pipe_buf_get);
1572 +
1573 +diff --git a/fs/splice.c b/fs/splice.c
1574 +index c78e0e3ff6c4..485e409ef841 100644
1575 +--- a/fs/splice.c
1576 ++++ b/fs/splice.c
1577 +@@ -1584,7 +1584,11 @@ retry:
1578 + * Get a reference to this pipe buffer,
1579 + * so we can copy the contents over.
1580 + */
1581 +- pipe_buf_get(ipipe, ibuf);
1582 ++ if (!pipe_buf_get(ipipe, ibuf)) {
1583 ++ if (ret == 0)
1584 ++ ret = -EFAULT;
1585 ++ break;
1586 ++ }
1587 + *obuf = *ibuf;
1588 +
1589 + /*
1590 +@@ -1658,7 +1662,11 @@ static int link_pipe(struct pipe_inode_info *ipipe,
1591 + * Get a reference to this pipe buffer,
1592 + * so we can copy the contents over.
1593 + */
1594 +- pipe_buf_get(ipipe, ibuf);
1595 ++ if (!pipe_buf_get(ipipe, ibuf)) {
1596 ++ if (ret == 0)
1597 ++ ret = -EFAULT;
1598 ++ break;
1599 ++ }
1600 +
1601 + obuf = opipe->bufs + nbuf;
1602 + *obuf = *ibuf;
1603 +diff --git a/include/linux/mm.h b/include/linux/mm.h
1604 +index e899460f1bc5..bdec425c8e14 100644
1605 +--- a/include/linux/mm.h
1606 ++++ b/include/linux/mm.h
1607 +@@ -915,6 +915,10 @@ static inline bool is_device_public_page(const struct page *page)
1608 + }
1609 + #endif /* CONFIG_DEV_PAGEMAP_OPS */
1610 +
1611 ++/* 127: arbitrary random number, small enough to assemble well */
1612 ++#define page_ref_zero_or_close_to_overflow(page) \
1613 ++ ((unsigned int) page_ref_count(page) + 127u <= 127u)
1614 ++
1615 + static inline void get_page(struct page *page)
1616 + {
1617 + page = compound_head(page);
1618 +@@ -922,8 +926,17 @@ static inline void get_page(struct page *page)
1619 + * Getting a normal page or the head of a compound page
1620 + * requires to already have an elevated page->_refcount.
1621 + */
1622 +- VM_BUG_ON_PAGE(page_ref_count(page) <= 0, page);
1623 ++ VM_BUG_ON_PAGE(page_ref_zero_or_close_to_overflow(page), page);
1624 ++ page_ref_inc(page);
1625 ++}
1626 ++
1627 ++static inline __must_check bool try_get_page(struct page *page)
1628 ++{
1629 ++ page = compound_head(page);
1630 ++ if (WARN_ON_ONCE(page_ref_count(page) <= 0))
1631 ++ return false;
1632 + page_ref_inc(page);
1633 ++ return true;
1634 + }
1635 +
1636 + static inline void put_page(struct page *page)
1637 +diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
1638 +index 66ee63cd5968..7897a3cc05b9 100644
1639 +--- a/include/linux/pipe_fs_i.h
1640 ++++ b/include/linux/pipe_fs_i.h
1641 +@@ -108,18 +108,20 @@ struct pipe_buf_operations {
1642 + /*
1643 + * Get a reference to the pipe buffer.
1644 + */
1645 +- void (*get)(struct pipe_inode_info *, struct pipe_buffer *);
1646 ++ bool (*get)(struct pipe_inode_info *, struct pipe_buffer *);
1647 + };
1648 +
1649 + /**
1650 + * pipe_buf_get - get a reference to a pipe_buffer
1651 + * @pipe: the pipe that the buffer belongs to
1652 + * @buf: the buffer to get a reference to
1653 ++ *
1654 ++ * Return: %true if the reference was successfully obtained.
1655 + */
1656 +-static inline void pipe_buf_get(struct pipe_inode_info *pipe,
1657 ++static inline __must_check bool pipe_buf_get(struct pipe_inode_info *pipe,
1658 + struct pipe_buffer *buf)
1659 + {
1660 +- buf->ops->get(pipe, buf);
1661 ++ return buf->ops->get(pipe, buf);
1662 + }
1663 +
1664 + /**
1665 +@@ -178,7 +180,7 @@ struct pipe_inode_info *alloc_pipe_info(void);
1666 + void free_pipe_info(struct pipe_inode_info *);
1667 +
1668 + /* Generic pipe buffer ops functions */
1669 +-void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);
1670 ++bool generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);
1671 + int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *);
1672 + int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
1673 + int generic_pipe_buf_nosteal(struct pipe_inode_info *, struct pipe_buffer *);
1674 +diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h
1675 +index 1be35729c2c5..660d78c9af6c 100644
1676 +--- a/include/linux/sched/signal.h
1677 ++++ b/include/linux/sched/signal.h
1678 +@@ -417,10 +417,20 @@ static inline void set_restore_sigmask(void)
1679 + set_thread_flag(TIF_RESTORE_SIGMASK);
1680 + WARN_ON(!test_thread_flag(TIF_SIGPENDING));
1681 + }
1682 ++
1683 ++static inline void clear_tsk_restore_sigmask(struct task_struct *tsk)
1684 ++{
1685 ++ clear_tsk_thread_flag(tsk, TIF_RESTORE_SIGMASK);
1686 ++}
1687 ++
1688 + static inline void clear_restore_sigmask(void)
1689 + {
1690 + clear_thread_flag(TIF_RESTORE_SIGMASK);
1691 + }
1692 ++static inline bool test_tsk_restore_sigmask(struct task_struct *tsk)
1693 ++{
1694 ++ return test_tsk_thread_flag(tsk, TIF_RESTORE_SIGMASK);
1695 ++}
1696 + static inline bool test_restore_sigmask(void)
1697 + {
1698 + return test_thread_flag(TIF_RESTORE_SIGMASK);
1699 +@@ -438,6 +448,10 @@ static inline void set_restore_sigmask(void)
1700 + current->restore_sigmask = true;
1701 + WARN_ON(!test_thread_flag(TIF_SIGPENDING));
1702 + }
1703 ++static inline void clear_tsk_restore_sigmask(struct task_struct *tsk)
1704 ++{
1705 ++ tsk->restore_sigmask = false;
1706 ++}
1707 + static inline void clear_restore_sigmask(void)
1708 + {
1709 + current->restore_sigmask = false;
1710 +@@ -446,6 +460,10 @@ static inline bool test_restore_sigmask(void)
1711 + {
1712 + return current->restore_sigmask;
1713 + }
1714 ++static inline bool test_tsk_restore_sigmask(struct task_struct *tsk)
1715 ++{
1716 ++ return tsk->restore_sigmask;
1717 ++}
1718 + static inline bool test_and_clear_restore_sigmask(void)
1719 + {
1720 + if (!current->restore_sigmask)
1721 +diff --git a/include/net/tc_act/tc_gact.h b/include/net/tc_act/tc_gact.h
1722 +index ef8dd0db70ce..56935bf027a7 100644
1723 +--- a/include/net/tc_act/tc_gact.h
1724 ++++ b/include/net/tc_act/tc_gact.h
1725 +@@ -56,7 +56,7 @@ static inline bool is_tcf_gact_goto_chain(const struct tc_action *a)
1726 +
1727 + static inline u32 tcf_gact_goto_chain_index(const struct tc_action *a)
1728 + {
1729 +- return a->goto_chain->index;
1730 ++ return READ_ONCE(a->tcfa_action) & TC_ACT_EXT_VAL_MASK;
1731 + }
1732 +
1733 + #endif /* __NET_TC_GACT_H */
1734 +diff --git a/include/net/xdp_sock.h b/include/net/xdp_sock.h
1735 +index 7161856bcf9c..c2c10cc9ffa0 100644
1736 +--- a/include/net/xdp_sock.h
1737 ++++ b/include/net/xdp_sock.h
1738 +@@ -34,7 +34,6 @@ struct xdp_umem {
1739 + u32 headroom;
1740 + u32 chunk_size_nohr;
1741 + struct user_struct *user;
1742 +- struct pid *pid;
1743 + unsigned long address;
1744 + refcount_t users;
1745 + struct work_struct work;
1746 +diff --git a/kernel/ptrace.c b/kernel/ptrace.c
1747 +index 21fec73d45d4..fc0d667f5792 100644
1748 +--- a/kernel/ptrace.c
1749 ++++ b/kernel/ptrace.c
1750 +@@ -29,6 +29,7 @@
1751 + #include <linux/hw_breakpoint.h>
1752 + #include <linux/cn_proc.h>
1753 + #include <linux/compat.h>
1754 ++#include <linux/sched/signal.h>
1755 +
1756 + /*
1757 + * Access another process' address space via ptrace.
1758 +@@ -925,18 +926,26 @@ int ptrace_request(struct task_struct *child, long request,
1759 + ret = ptrace_setsiginfo(child, &siginfo);
1760 + break;
1761 +
1762 +- case PTRACE_GETSIGMASK:
1763 ++ case PTRACE_GETSIGMASK: {
1764 ++ sigset_t *mask;
1765 ++
1766 + if (addr != sizeof(sigset_t)) {
1767 + ret = -EINVAL;
1768 + break;
1769 + }
1770 +
1771 +- if (copy_to_user(datavp, &child->blocked, sizeof(sigset_t)))
1772 ++ if (test_tsk_restore_sigmask(child))
1773 ++ mask = &child->saved_sigmask;
1774 ++ else
1775 ++ mask = &child->blocked;
1776 ++
1777 ++ if (copy_to_user(datavp, mask, sizeof(sigset_t)))
1778 + ret = -EFAULT;
1779 + else
1780 + ret = 0;
1781 +
1782 + break;
1783 ++ }
1784 +
1785 + case PTRACE_SETSIGMASK: {
1786 + sigset_t new_set;
1787 +@@ -962,6 +971,8 @@ int ptrace_request(struct task_struct *child, long request,
1788 + child->blocked = new_set;
1789 + spin_unlock_irq(&child->sighand->siglock);
1790 +
1791 ++ clear_tsk_restore_sigmask(child);
1792 ++
1793 + ret = 0;
1794 + break;
1795 + }
1796 +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
1797 +index 5455ee05bc3b..1bd7a758583b 100644
1798 +--- a/kernel/trace/trace.c
1799 ++++ b/kernel/trace/trace.c
1800 +@@ -6823,12 +6823,16 @@ static void buffer_pipe_buf_release(struct pipe_inode_info *pipe,
1801 + buf->private = 0;
1802 + }
1803 +
1804 +-static void buffer_pipe_buf_get(struct pipe_inode_info *pipe,
1805 ++static bool buffer_pipe_buf_get(struct pipe_inode_info *pipe,
1806 + struct pipe_buffer *buf)
1807 + {
1808 + struct buffer_ref *ref = (struct buffer_ref *)buf->private;
1809 +
1810 ++ if (refcount_read(&ref->refcount) > INT_MAX/2)
1811 ++ return false;
1812 ++
1813 + refcount_inc(&ref->refcount);
1814 ++ return true;
1815 + }
1816 +
1817 + /* Pipe buffer operations for a buffer. */
1818 +diff --git a/mm/gup.c b/mm/gup.c
1819 +index 0a5374e6e82d..caadd31714a5 100644
1820 +--- a/mm/gup.c
1821 ++++ b/mm/gup.c
1822 +@@ -153,7 +153,10 @@ retry:
1823 + }
1824 +
1825 + if (flags & FOLL_GET) {
1826 +- get_page(page);
1827 ++ if (unlikely(!try_get_page(page))) {
1828 ++ page = ERR_PTR(-ENOMEM);
1829 ++ goto out;
1830 ++ }
1831 +
1832 + /* drop the pgmap reference now that we hold the page */
1833 + if (pgmap) {
1834 +@@ -296,7 +299,10 @@ retry_locked:
1835 + if (pmd_trans_unstable(pmd))
1836 + ret = -EBUSY;
1837 + } else {
1838 +- get_page(page);
1839 ++ if (unlikely(!try_get_page(page))) {
1840 ++ spin_unlock(ptl);
1841 ++ return ERR_PTR(-ENOMEM);
1842 ++ }
1843 + spin_unlock(ptl);
1844 + lock_page(page);
1845 + ret = split_huge_page(page);
1846 +@@ -480,7 +486,10 @@ static int get_gate_page(struct mm_struct *mm, unsigned long address,
1847 + if (is_device_public_page(*page))
1848 + goto unmap;
1849 + }
1850 +- get_page(*page);
1851 ++ if (unlikely(!try_get_page(*page))) {
1852 ++ ret = -ENOMEM;
1853 ++ goto unmap;
1854 ++ }
1855 + out:
1856 + ret = 0;
1857 + unmap:
1858 +@@ -1368,6 +1377,20 @@ static void undo_dev_pagemap(int *nr, int nr_start, struct page **pages)
1859 + }
1860 + }
1861 +
1862 ++/*
1863 ++ * Return the compund head page with ref appropriately incremented,
1864 ++ * or NULL if that failed.
1865 ++ */
1866 ++static inline struct page *try_get_compound_head(struct page *page, int refs)
1867 ++{
1868 ++ struct page *head = compound_head(page);
1869 ++ if (WARN_ON_ONCE(page_ref_count(head) < 0))
1870 ++ return NULL;
1871 ++ if (unlikely(!page_cache_add_speculative(head, refs)))
1872 ++ return NULL;
1873 ++ return head;
1874 ++}
1875 ++
1876 + #ifdef CONFIG_ARCH_HAS_PTE_SPECIAL
1877 + static int gup_pte_range(pmd_t pmd, unsigned long addr, unsigned long end,
1878 + int write, struct page **pages, int *nr)
1879 +@@ -1402,9 +1425,9 @@ static int gup_pte_range(pmd_t pmd, unsigned long addr, unsigned long end,
1880 +
1881 + VM_BUG_ON(!pfn_valid(pte_pfn(pte)));
1882 + page = pte_page(pte);
1883 +- head = compound_head(page);
1884 +
1885 +- if (!page_cache_get_speculative(head))
1886 ++ head = try_get_compound_head(page, 1);
1887 ++ if (!head)
1888 + goto pte_unmap;
1889 +
1890 + if (unlikely(pte_val(pte) != pte_val(*ptep))) {
1891 +@@ -1543,8 +1566,8 @@ static int gup_huge_pmd(pmd_t orig, pmd_t *pmdp, unsigned long addr,
1892 + refs++;
1893 + } while (addr += PAGE_SIZE, addr != end);
1894 +
1895 +- head = compound_head(pmd_page(orig));
1896 +- if (!page_cache_add_speculative(head, refs)) {
1897 ++ head = try_get_compound_head(pmd_page(orig), refs);
1898 ++ if (!head) {
1899 + *nr -= refs;
1900 + return 0;
1901 + }
1902 +@@ -1581,8 +1604,8 @@ static int gup_huge_pud(pud_t orig, pud_t *pudp, unsigned long addr,
1903 + refs++;
1904 + } while (addr += PAGE_SIZE, addr != end);
1905 +
1906 +- head = compound_head(pud_page(orig));
1907 +- if (!page_cache_add_speculative(head, refs)) {
1908 ++ head = try_get_compound_head(pud_page(orig), refs);
1909 ++ if (!head) {
1910 + *nr -= refs;
1911 + return 0;
1912 + }
1913 +@@ -1618,8 +1641,8 @@ static int gup_huge_pgd(pgd_t orig, pgd_t *pgdp, unsigned long addr,
1914 + refs++;
1915 + } while (addr += PAGE_SIZE, addr != end);
1916 +
1917 +- head = compound_head(pgd_page(orig));
1918 +- if (!page_cache_add_speculative(head, refs)) {
1919 ++ head = try_get_compound_head(pgd_page(orig), refs);
1920 ++ if (!head) {
1921 + *nr -= refs;
1922 + return 0;
1923 + }
1924 +diff --git a/mm/hugetlb.c b/mm/hugetlb.c
1925 +index 9e5f66cbf711..5fb779cda972 100644
1926 +--- a/mm/hugetlb.c
1927 ++++ b/mm/hugetlb.c
1928 +@@ -4299,6 +4299,19 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
1929 +
1930 + pfn_offset = (vaddr & ~huge_page_mask(h)) >> PAGE_SHIFT;
1931 + page = pte_page(huge_ptep_get(pte));
1932 ++
1933 ++ /*
1934 ++ * Instead of doing 'try_get_page()' below in the same_page
1935 ++ * loop, just check the count once here.
1936 ++ */
1937 ++ if (unlikely(page_count(page) <= 0)) {
1938 ++ if (pages) {
1939 ++ spin_unlock(ptl);
1940 ++ remainder = 0;
1941 ++ err = -ENOMEM;
1942 ++ break;
1943 ++ }
1944 ++ }
1945 + same_page:
1946 + if (pages) {
1947 + pages[i] = mem_map_offset(page, pfn_offset);
1948 +diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c
1949 +index 3b0a03b92080..212c184c1eee 100644
1950 +--- a/net/bridge/br_netfilter_hooks.c
1951 ++++ b/net/bridge/br_netfilter_hooks.c
1952 +@@ -515,6 +515,7 @@ static unsigned int br_nf_pre_routing(void *priv,
1953 + nf_bridge->ipv4_daddr = ip_hdr(skb)->daddr;
1954 +
1955 + skb->protocol = htons(ETH_P_IP);
1956 ++ skb->transport_header = skb->network_header + ip_hdr(skb)->ihl * 4;
1957 +
1958 + NF_HOOK(NFPROTO_IPV4, NF_INET_PRE_ROUTING, state->net, state->sk, skb,
1959 + skb->dev, NULL,
1960 +diff --git a/net/bridge/br_netfilter_ipv6.c b/net/bridge/br_netfilter_ipv6.c
1961 +index 5811208863b7..09d5e0c7b3ba 100644
1962 +--- a/net/bridge/br_netfilter_ipv6.c
1963 ++++ b/net/bridge/br_netfilter_ipv6.c
1964 +@@ -235,6 +235,8 @@ unsigned int br_nf_pre_routing_ipv6(void *priv,
1965 + nf_bridge->ipv6_daddr = ipv6_hdr(skb)->daddr;
1966 +
1967 + skb->protocol = htons(ETH_P_IPV6);
1968 ++ skb->transport_header = skb->network_header + sizeof(struct ipv6hdr);
1969 ++
1970 + NF_HOOK(NFPROTO_IPV6, NF_INET_PRE_ROUTING, state->net, state->sk, skb,
1971 + skb->dev, NULL,
1972 + br_nf_pre_routing_finish_ipv6);
1973 +diff --git a/net/ipv6/netfilter/ip6t_srh.c b/net/ipv6/netfilter/ip6t_srh.c
1974 +index 1059894a6f4c..4cb83fb69844 100644
1975 +--- a/net/ipv6/netfilter/ip6t_srh.c
1976 ++++ b/net/ipv6/netfilter/ip6t_srh.c
1977 +@@ -210,6 +210,8 @@ static bool srh1_mt6(const struct sk_buff *skb, struct xt_action_param *par)
1978 + psidoff = srhoff + sizeof(struct ipv6_sr_hdr) +
1979 + ((srh->segments_left + 1) * sizeof(struct in6_addr));
1980 + psid = skb_header_pointer(skb, psidoff, sizeof(_psid), &_psid);
1981 ++ if (!psid)
1982 ++ return false;
1983 + if (NF_SRH_INVF(srhinfo, IP6T_SRH_INV_PSID,
1984 + ipv6_masked_addr_cmp(psid, &srhinfo->psid_msk,
1985 + &srhinfo->psid_addr)))
1986 +@@ -223,6 +225,8 @@ static bool srh1_mt6(const struct sk_buff *skb, struct xt_action_param *par)
1987 + nsidoff = srhoff + sizeof(struct ipv6_sr_hdr) +
1988 + ((srh->segments_left - 1) * sizeof(struct in6_addr));
1989 + nsid = skb_header_pointer(skb, nsidoff, sizeof(_nsid), &_nsid);
1990 ++ if (!nsid)
1991 ++ return false;
1992 + if (NF_SRH_INVF(srhinfo, IP6T_SRH_INV_NSID,
1993 + ipv6_masked_addr_cmp(nsid, &srhinfo->nsid_msk,
1994 + &srhinfo->nsid_addr)))
1995 +@@ -233,6 +237,8 @@ static bool srh1_mt6(const struct sk_buff *skb, struct xt_action_param *par)
1996 + if (srhinfo->mt_flags & IP6T_SRH_LSID) {
1997 + lsidoff = srhoff + sizeof(struct ipv6_sr_hdr);
1998 + lsid = skb_header_pointer(skb, lsidoff, sizeof(_lsid), &_lsid);
1999 ++ if (!lsid)
2000 ++ return false;
2001 + if (NF_SRH_INVF(srhinfo, IP6T_SRH_INV_LSID,
2002 + ipv6_masked_addr_cmp(lsid, &srhinfo->lsid_msk,
2003 + &srhinfo->lsid_addr)))
2004 +diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
2005 +index f61c306de1d0..e0fb56d67d42 100644
2006 +--- a/net/netfilter/Kconfig
2007 ++++ b/net/netfilter/Kconfig
2008 +@@ -1003,6 +1003,7 @@ config NETFILTER_XT_TARGET_TEE
2009 + depends on NETFILTER_ADVANCED
2010 + depends on IPV6 || IPV6=n
2011 + depends on !NF_CONNTRACK || NF_CONNTRACK
2012 ++ depends on IP6_NF_IPTABLES || !IP6_NF_IPTABLES
2013 + select NF_DUP_IPV4
2014 + select NF_DUP_IPV6 if IP6_NF_IPTABLES
2015 + ---help---
2016 +diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c
2017 +index 0e5ec126f6ad..b3e75f9cb686 100644
2018 +--- a/net/netfilter/nft_set_rbtree.c
2019 ++++ b/net/netfilter/nft_set_rbtree.c
2020 +@@ -302,10 +302,6 @@ static void *nft_rbtree_deactivate(const struct net *net,
2021 + else if (d > 0)
2022 + parent = parent->rb_right;
2023 + else {
2024 +- if (!nft_set_elem_active(&rbe->ext, genmask)) {
2025 +- parent = parent->rb_left;
2026 +- continue;
2027 +- }
2028 + if (nft_rbtree_interval_end(rbe) &&
2029 + !nft_rbtree_interval_end(this)) {
2030 + parent = parent->rb_left;
2031 +@@ -314,6 +310,9 @@ static void *nft_rbtree_deactivate(const struct net *net,
2032 + nft_rbtree_interval_end(this)) {
2033 + parent = parent->rb_right;
2034 + continue;
2035 ++ } else if (!nft_set_elem_active(&rbe->ext, genmask)) {
2036 ++ parent = parent->rb_left;
2037 ++ continue;
2038 + }
2039 + nft_rbtree_flush(net, set, rbe);
2040 + return rbe;
2041 +diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c
2042 +index bfe2dbea480b..a3b037fbfecd 100644
2043 +--- a/net/xdp/xdp_umem.c
2044 ++++ b/net/xdp/xdp_umem.c
2045 +@@ -152,9 +152,6 @@ static void xdp_umem_unaccount_pages(struct xdp_umem *umem)
2046 +
2047 + static void xdp_umem_release(struct xdp_umem *umem)
2048 + {
2049 +- struct task_struct *task;
2050 +- struct mm_struct *mm;
2051 +-
2052 + xdp_umem_clear_dev(umem);
2053 +
2054 + if (umem->fq) {
2055 +@@ -169,21 +166,10 @@ static void xdp_umem_release(struct xdp_umem *umem)
2056 +
2057 + xdp_umem_unpin_pages(umem);
2058 +
2059 +- task = get_pid_task(umem->pid, PIDTYPE_PID);
2060 +- put_pid(umem->pid);
2061 +- if (!task)
2062 +- goto out;
2063 +- mm = get_task_mm(task);
2064 +- put_task_struct(task);
2065 +- if (!mm)
2066 +- goto out;
2067 +-
2068 +- mmput(mm);
2069 + kfree(umem->pages);
2070 + umem->pages = NULL;
2071 +
2072 + xdp_umem_unaccount_pages(umem);
2073 +-out:
2074 + kfree(umem);
2075 + }
2076 +
2077 +@@ -312,7 +298,6 @@ static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)
2078 + if (size_chk < 0)
2079 + return -EINVAL;
2080 +
2081 +- umem->pid = get_task_pid(current, PIDTYPE_PID);
2082 + umem->address = (unsigned long)addr;
2083 + umem->props.chunk_mask = ~((u64)chunk_size - 1);
2084 + umem->props.size = size;
2085 +@@ -328,7 +313,7 @@ static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)
2086 +
2087 + err = xdp_umem_account_pages(umem);
2088 + if (err)
2089 +- goto out;
2090 ++ return err;
2091 +
2092 + err = xdp_umem_pin_pages(umem);
2093 + if (err)
2094 +@@ -347,8 +332,6 @@ static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)
2095 +
2096 + out_account:
2097 + xdp_umem_unaccount_pages(umem);
2098 +-out:
2099 +- put_pid(umem->pid);
2100 + return err;
2101 + }
2102 +
2103 +diff --git a/scripts/kconfig/lxdialog/inputbox.c b/scripts/kconfig/lxdialog/inputbox.c
2104 +index fe82ff6d744e..b15c8d1744f5 100644
2105 +--- a/scripts/kconfig/lxdialog/inputbox.c
2106 ++++ b/scripts/kconfig/lxdialog/inputbox.c
2107 +@@ -126,7 +126,8 @@ do_resize:
2108 + case KEY_DOWN:
2109 + break;
2110 + case KEY_BACKSPACE:
2111 +- case 127:
2112 ++ case 8: /* ^H */
2113 ++ case 127: /* ^? */
2114 + if (pos) {
2115 + wattrset(dialog, dlg.inputbox.atr);
2116 + if (input_x == 0) {
2117 +diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
2118 +index 1ef232ae5ab9..c8ff1c99dd5c 100644
2119 +--- a/scripts/kconfig/nconf.c
2120 ++++ b/scripts/kconfig/nconf.c
2121 +@@ -1049,7 +1049,7 @@ static int do_match(int key, struct match_state *state, int *ans)
2122 + state->match_direction = FIND_NEXT_MATCH_UP;
2123 + *ans = get_mext_match(state->pattern,
2124 + state->match_direction);
2125 +- } else if (key == KEY_BACKSPACE || key == 127) {
2126 ++ } else if (key == KEY_BACKSPACE || key == 8 || key == 127) {
2127 + state->pattern[strlen(state->pattern)-1] = '\0';
2128 + adj_match_dir(&state->match_direction);
2129 + } else
2130 +diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c
2131 +index 88874acfda36..820fc9256532 100644
2132 +--- a/scripts/kconfig/nconf.gui.c
2133 ++++ b/scripts/kconfig/nconf.gui.c
2134 +@@ -440,7 +440,8 @@ int dialog_inputbox(WINDOW *main_window,
2135 + case KEY_F(F_EXIT):
2136 + case KEY_F(F_BACK):
2137 + break;
2138 +- case 127:
2139 ++ case 8: /* ^H */
2140 ++ case 127: /* ^? */
2141 + case KEY_BACKSPACE:
2142 + if (cursor_position > 0) {
2143 + memmove(&result[cursor_position-1],
2144 +diff --git a/scripts/selinux/genheaders/genheaders.c b/scripts/selinux/genheaders/genheaders.c
2145 +index fa48fabcb330..3cc4893d98cc 100644
2146 +--- a/scripts/selinux/genheaders/genheaders.c
2147 ++++ b/scripts/selinux/genheaders/genheaders.c
2148 +@@ -9,7 +9,6 @@
2149 + #include <string.h>
2150 + #include <errno.h>
2151 + #include <ctype.h>
2152 +-#include <sys/socket.h>
2153 +
2154 + struct security_class_mapping {
2155 + const char *name;
2156 +diff --git a/scripts/selinux/mdp/mdp.c b/scripts/selinux/mdp/mdp.c
2157 +index 073fe7537f6c..6d51b74bc679 100644
2158 +--- a/scripts/selinux/mdp/mdp.c
2159 ++++ b/scripts/selinux/mdp/mdp.c
2160 +@@ -32,7 +32,6 @@
2161 + #include <stdlib.h>
2162 + #include <unistd.h>
2163 + #include <string.h>
2164 +-#include <sys/socket.h>
2165 +
2166 + static void usage(char *name)
2167 + {
2168 +diff --git a/security/selinux/include/classmap.h b/security/selinux/include/classmap.h
2169 +index bd5fe0d3204a..201f7e588a29 100644
2170 +--- a/security/selinux/include/classmap.h
2171 ++++ b/security/selinux/include/classmap.h
2172 +@@ -1,5 +1,6 @@
2173 + /* SPDX-License-Identifier: GPL-2.0 */
2174 + #include <linux/capability.h>
2175 ++#include <linux/socket.h>
2176 +
2177 + #define COMMON_FILE_SOCK_PERMS "ioctl", "read", "write", "create", \
2178 + "getattr", "setattr", "lock", "relabelfrom", "relabelto", "append", "map"
2179 +diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
2180 +index b1508ce3e412..076718a7b3ea 100644
2181 +--- a/tools/perf/util/machine.c
2182 ++++ b/tools/perf/util/machine.c
2183 +@@ -1358,6 +1358,20 @@ static void machine__set_kernel_mmap(struct machine *machine,
2184 + machine->vmlinux_map->end = ~0ULL;
2185 + }
2186 +
2187 ++static void machine__update_kernel_mmap(struct machine *machine,
2188 ++ u64 start, u64 end)
2189 ++{
2190 ++ struct map *map = machine__kernel_map(machine);
2191 ++
2192 ++ map__get(map);
2193 ++ map_groups__remove(&machine->kmaps, map);
2194 ++
2195 ++ machine__set_kernel_mmap(machine, start, end);
2196 ++
2197 ++ map_groups__insert(&machine->kmaps, map);
2198 ++ map__put(map);
2199 ++}
2200 ++
2201 + int machine__create_kernel_maps(struct machine *machine)
2202 + {
2203 + struct dso *kernel = machine__get_kernel(machine);
2204 +@@ -1390,17 +1404,11 @@ int machine__create_kernel_maps(struct machine *machine)
2205 + goto out_put;
2206 + }
2207 +
2208 +- /* we have a real start address now, so re-order the kmaps */
2209 +- map = machine__kernel_map(machine);
2210 +-
2211 +- map__get(map);
2212 +- map_groups__remove(&machine->kmaps, map);
2213 +-
2214 +- /* assume it's the last in the kmaps */
2215 +- machine__set_kernel_mmap(machine, addr, ~0ULL);
2216 +-
2217 +- map_groups__insert(&machine->kmaps, map);
2218 +- map__put(map);
2219 ++ /*
2220 ++ * we have a real start address now, so re-order the kmaps
2221 ++ * assume it's the last in the kmaps
2222 ++ */
2223 ++ machine__update_kernel_mmap(machine, addr, ~0ULL);
2224 + }
2225 +
2226 + if (machine__create_extra_kernel_maps(machine, kernel))
2227 +@@ -1536,7 +1544,7 @@ static int machine__process_kernel_mmap_event(struct machine *machine,
2228 + if (strstr(kernel->long_name, "vmlinux"))
2229 + dso__set_short_name(kernel, "[kernel.vmlinux]", false);
2230 +
2231 +- machine__set_kernel_mmap(machine, event->mmap.start,
2232 ++ machine__update_kernel_mmap(machine, event->mmap.start,
2233 + event->mmap.start + event->mmap.len);
2234 +
2235 + /*
2236 +diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
2237 +index f376c82afb61..621bb004067e 100644
2238 +--- a/virt/kvm/arm/vgic/vgic-its.c
2239 ++++ b/virt/kvm/arm/vgic/vgic-its.c
2240 +@@ -760,8 +760,9 @@ static bool vgic_its_check_id(struct vgic_its *its, u64 baser, u32 id,
2241 + int l1_tbl_size = GITS_BASER_NR_PAGES(baser) * SZ_64K;
2242 + u64 indirect_ptr, type = GITS_BASER_TYPE(baser);
2243 + int esz = GITS_BASER_ENTRY_SIZE(baser);
2244 +- int index;
2245 ++ int index, idx;
2246 + gfn_t gfn;
2247 ++ bool ret;
2248 +
2249 + switch (type) {
2250 + case GITS_BASER_TYPE_DEVICE:
2251 +@@ -788,7 +789,8 @@ static bool vgic_its_check_id(struct vgic_its *its, u64 baser, u32 id,
2252 +
2253 + if (eaddr)
2254 + *eaddr = addr;
2255 +- return kvm_is_visible_gfn(its->dev->kvm, gfn);
2256 ++
2257 ++ goto out;
2258 + }
2259 +
2260 + /* calculate and check the index into the 1st level */
2261 +@@ -822,7 +824,12 @@ static bool vgic_its_check_id(struct vgic_its *its, u64 baser, u32 id,
2262 +
2263 + if (eaddr)
2264 + *eaddr = indirect_ptr;
2265 +- return kvm_is_visible_gfn(its->dev->kvm, gfn);
2266 ++
2267 ++out:
2268 ++ idx = srcu_read_lock(&its->dev->kvm->srcu);
2269 ++ ret = kvm_is_visible_gfn(its->dev->kvm, gfn);
2270 ++ srcu_read_unlock(&its->dev->kvm->srcu, idx);
2271 ++ return ret;
2272 + }
2273 +
2274 + static int vgic_its_alloc_collection(struct vgic_its *its,
2275 +@@ -1935,7 +1942,7 @@ static int vgic_its_save_ite(struct vgic_its *its, struct its_device *dev,
2276 + ((u64)ite->irq->intid << KVM_ITS_ITE_PINTID_SHIFT) |
2277 + ite->collection->collection_id;
2278 + val = cpu_to_le64(val);
2279 +- return kvm_write_guest(kvm, gpa, &val, ite_esz);
2280 ++ return kvm_write_guest_lock(kvm, gpa, &val, ite_esz);
2281 + }
2282 +
2283 + /**
2284 +@@ -2082,7 +2089,7 @@ static int vgic_its_save_dte(struct vgic_its *its, struct its_device *dev,
2285 + (itt_addr_field << KVM_ITS_DTE_ITTADDR_SHIFT) |
2286 + (dev->num_eventid_bits - 1));
2287 + val = cpu_to_le64(val);
2288 +- return kvm_write_guest(kvm, ptr, &val, dte_esz);
2289 ++ return kvm_write_guest_lock(kvm, ptr, &val, dte_esz);
2290 + }
2291 +
2292 + /**
2293 +@@ -2262,7 +2269,7 @@ static int vgic_its_save_cte(struct vgic_its *its,
2294 + ((u64)collection->target_addr << KVM_ITS_CTE_RDBASE_SHIFT) |
2295 + collection->collection_id);
2296 + val = cpu_to_le64(val);
2297 +- return kvm_write_guest(its->dev->kvm, gpa, &val, esz);
2298 ++ return kvm_write_guest_lock(its->dev->kvm, gpa, &val, esz);
2299 + }
2300 +
2301 + static int vgic_its_restore_cte(struct vgic_its *its, gpa_t gpa, int esz)
2302 +@@ -2333,7 +2340,7 @@ static int vgic_its_save_collection_table(struct vgic_its *its)
2303 + */
2304 + val = 0;
2305 + BUG_ON(cte_esz > sizeof(val));
2306 +- ret = kvm_write_guest(its->dev->kvm, gpa, &val, cte_esz);
2307 ++ ret = kvm_write_guest_lock(its->dev->kvm, gpa, &val, cte_esz);
2308 + return ret;
2309 + }
2310 +
2311 +diff --git a/virt/kvm/arm/vgic/vgic-v3.c b/virt/kvm/arm/vgic/vgic-v3.c
2312 +index 9c0dd234ebe8..3f2350a4d4ab 100644
2313 +--- a/virt/kvm/arm/vgic/vgic-v3.c
2314 ++++ b/virt/kvm/arm/vgic/vgic-v3.c
2315 +@@ -358,7 +358,7 @@ retry:
2316 + if (status) {
2317 + /* clear consumed data */
2318 + val &= ~(1 << bit_nr);
2319 +- ret = kvm_write_guest(kvm, ptr, &val, 1);
2320 ++ ret = kvm_write_guest_lock(kvm, ptr, &val, 1);
2321 + if (ret)
2322 + return ret;
2323 + }
2324 +@@ -409,7 +409,7 @@ int vgic_v3_save_pending_tables(struct kvm *kvm)
2325 + else
2326 + val &= ~(1 << bit_nr);
2327 +
2328 +- ret = kvm_write_guest(kvm, ptr, &val, 1);
2329 ++ ret = kvm_write_guest_lock(kvm, ptr, &val, 1);
2330 + if (ret)
2331 + return ret;
2332 + }