Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.9 commit in: /
Date: Wed, 03 Jun 2020 11:37:41
Message-Id: 1591184244.68f443419ead73af26f81e6585ca9e5095e5803a.mpagano@gentoo
1 commit: 68f443419ead73af26f81e6585ca9e5095e5803a
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 3 11:37:24 2020 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 3 11:37:24 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=68f44341
7
8 Linux patch 4.9.226
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1225_linux-4.9.226.patch | 1518 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 1522 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index ae2c4f5..d0e9162 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -943,6 +943,10 @@ Patch: 1224_linux-4.9.225.patch
21 From: http://www.kernel.org
22 Desc: Linux 4.9.225
23
24 +Patch: 1225_linux-4.9.226.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 4.9.226
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/1225_linux-4.9.226.patch b/1225_linux-4.9.226.patch
33 new file mode 100644
34 index 0000000..0e753fd
35 --- /dev/null
36 +++ b/1225_linux-4.9.226.patch
37 @@ -0,0 +1,1518 @@
38 +diff --git a/Makefile b/Makefile
39 +index d17a2ad3cc4d..b0e1162fddfa 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,6 +1,6 @@
43 + VERSION = 4
44 + PATCHLEVEL = 9
45 +-SUBLEVEL = 225
46 ++SUBLEVEL = 226
47 + EXTRAVERSION =
48 + NAME = Roaring Lionus
49 +
50 +diff --git a/arch/arm/boot/dts/imx6q-b450v3.dts b/arch/arm/boot/dts/imx6q-b450v3.dts
51 +index 78bfc1a307d6..ebc6e10f8624 100644
52 +--- a/arch/arm/boot/dts/imx6q-b450v3.dts
53 ++++ b/arch/arm/boot/dts/imx6q-b450v3.dts
54 +@@ -65,13 +65,6 @@
55 + };
56 + };
57 +
58 +-&clks {
59 +- assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
60 +- <&clks IMX6QDL_CLK_LDB_DI1_SEL>;
61 +- assigned-clock-parents = <&clks IMX6QDL_CLK_PLL3_USB_OTG>,
62 +- <&clks IMX6QDL_CLK_PLL3_USB_OTG>;
63 +-};
64 +-
65 + &ldb {
66 + status = "okay";
67 +
68 +diff --git a/arch/arm/boot/dts/imx6q-b650v3.dts b/arch/arm/boot/dts/imx6q-b650v3.dts
69 +index d85388725426..681aa612e07f 100644
70 +--- a/arch/arm/boot/dts/imx6q-b650v3.dts
71 ++++ b/arch/arm/boot/dts/imx6q-b650v3.dts
72 +@@ -65,13 +65,6 @@
73 + };
74 + };
75 +
76 +-&clks {
77 +- assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
78 +- <&clks IMX6QDL_CLK_LDB_DI1_SEL>;
79 +- assigned-clock-parents = <&clks IMX6QDL_CLK_PLL3_USB_OTG>,
80 +- <&clks IMX6QDL_CLK_PLL3_USB_OTG>;
81 +-};
82 +-
83 + &ldb {
84 + status = "okay";
85 +
86 +diff --git a/arch/arm/boot/dts/imx6q-b850v3.dts b/arch/arm/boot/dts/imx6q-b850v3.dts
87 +index 167f7446722a..8596df4078e9 100644
88 +--- a/arch/arm/boot/dts/imx6q-b850v3.dts
89 ++++ b/arch/arm/boot/dts/imx6q-b850v3.dts
90 +@@ -53,17 +53,6 @@
91 + };
92 + };
93 +
94 +-&clks {
95 +- assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
96 +- <&clks IMX6QDL_CLK_LDB_DI1_SEL>,
97 +- <&clks IMX6QDL_CLK_IPU1_DI0_PRE_SEL>,
98 +- <&clks IMX6QDL_CLK_IPU1_DI1_PRE_SEL>;
99 +- assigned-clock-parents = <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
100 +- <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
101 +- <&clks IMX6QDL_CLK_PLL2_PFD2_396M>,
102 +- <&clks IMX6QDL_CLK_PLL2_PFD2_396M>;
103 +-};
104 +-
105 + &ldb {
106 + fsl,dual-channel;
107 + status = "okay";
108 +diff --git a/arch/arm/boot/dts/imx6q-bx50v3.dtsi b/arch/arm/boot/dts/imx6q-bx50v3.dtsi
109 +index e4a415fd899b..cee0e19f180f 100644
110 +--- a/arch/arm/boot/dts/imx6q-bx50v3.dtsi
111 ++++ b/arch/arm/boot/dts/imx6q-bx50v3.dtsi
112 +@@ -92,6 +92,56 @@
113 + mux-int-port = <1>;
114 + mux-ext-port = <4>;
115 + };
116 ++
117 ++ aliases {
118 ++ mdio-gpio0 = &mdio0;
119 ++ };
120 ++
121 ++ mdio0: mdio-gpio {
122 ++ compatible = "virtual,mdio-gpio";
123 ++ gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>, /* mdc */
124 ++ <&gpio2 7 GPIO_ACTIVE_HIGH>; /* mdio */
125 ++
126 ++ #address-cells = <1>;
127 ++ #size-cells = <0>;
128 ++
129 ++ switch@0 {
130 ++ compatible = "marvell,mv88e6085"; /* 88e6240*/
131 ++ #address-cells = <1>;
132 ++ #size-cells = <0>;
133 ++ reg = <0>;
134 ++
135 ++ switch_ports: ports {
136 ++ #address-cells = <1>;
137 ++ #size-cells = <0>;
138 ++ };
139 ++
140 ++ mdio {
141 ++ #address-cells = <1>;
142 ++ #size-cells = <0>;
143 ++
144 ++ switchphy0: switchphy@0 {
145 ++ reg = <0>;
146 ++ };
147 ++
148 ++ switchphy1: switchphy@1 {
149 ++ reg = <1>;
150 ++ };
151 ++
152 ++ switchphy2: switchphy@2 {
153 ++ reg = <2>;
154 ++ };
155 ++
156 ++ switchphy3: switchphy@3 {
157 ++ reg = <3>;
158 ++ };
159 ++
160 ++ switchphy4: switchphy@4 {
161 ++ reg = <4>;
162 ++ };
163 ++ };
164 ++ };
165 ++ };
166 + };
167 +
168 + &ecspi5 {
169 +@@ -299,3 +349,30 @@
170 + tcxo-clock-frequency = <26000000>;
171 + };
172 + };
173 ++
174 ++&pcie {
175 ++ /* Synopsys, Inc. Device */
176 ++ pci_root: root@0,0 {
177 ++ compatible = "pci16c3,abcd";
178 ++ reg = <0x00000000 0 0 0 0>;
179 ++
180 ++ #address-cells = <3>;
181 ++ #size-cells = <2>;
182 ++ #interrupt-cells = <1>;
183 ++ };
184 ++};
185 ++
186 ++&clks {
187 ++ assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
188 ++ <&clks IMX6QDL_CLK_LDB_DI1_SEL>,
189 ++ <&clks IMX6QDL_CLK_IPU1_DI0_PRE_SEL>,
190 ++ <&clks IMX6QDL_CLK_IPU1_DI1_PRE_SEL>,
191 ++ <&clks IMX6QDL_CLK_IPU2_DI0_PRE_SEL>,
192 ++ <&clks IMX6QDL_CLK_IPU2_DI1_PRE_SEL>;
193 ++ assigned-clock-parents = <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
194 ++ <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
195 ++ <&clks IMX6QDL_CLK_PLL2_PFD0_352M>,
196 ++ <&clks IMX6QDL_CLK_PLL2_PFD0_352M>,
197 ++ <&clks IMX6QDL_CLK_PLL2_PFD0_352M>,
198 ++ <&clks IMX6QDL_CLK_PLL2_PFD0_352M>;
199 ++};
200 +diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
201 +index b9db8e529e4d..dbbe3932f833 100644
202 +--- a/arch/parisc/mm/init.c
203 ++++ b/arch/parisc/mm/init.c
204 +@@ -604,7 +604,7 @@ void __init mem_init(void)
205 + > BITS_PER_LONG);
206 +
207 + high_memory = __va((max_pfn << PAGE_SHIFT));
208 +- set_max_mapnr(page_to_pfn(virt_to_page(high_memory - 1)) + 1);
209 ++ set_max_mapnr(max_low_pfn);
210 + free_all_bootmem();
211 +
212 + #ifdef CONFIG_PA11
213 +diff --git a/arch/x86/include/asm/dma.h b/arch/x86/include/asm/dma.h
214 +index fe884e18fa6e..c7854a098b6b 100644
215 +--- a/arch/x86/include/asm/dma.h
216 ++++ b/arch/x86/include/asm/dma.h
217 +@@ -73,7 +73,7 @@
218 + #define MAX_DMA_PFN ((16UL * 1024 * 1024) >> PAGE_SHIFT)
219 +
220 + /* 4GB broken PCI/AGP hardware bus master zone */
221 +-#define MAX_DMA32_PFN ((4UL * 1024 * 1024 * 1024) >> PAGE_SHIFT)
222 ++#define MAX_DMA32_PFN (1UL << (32 - PAGE_SHIFT))
223 +
224 + #ifdef CONFIG_X86_32
225 + /* The maximum address that we can perform a DMA transfer to on this platform */
226 +diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
227 +index 05d3241ad20b..9d763557a105 100644
228 +--- a/drivers/gpio/gpio-tegra.c
229 ++++ b/drivers/gpio/gpio-tegra.c
230 +@@ -341,6 +341,7 @@ static void tegra_gpio_irq_shutdown(struct irq_data *d)
231 + struct tegra_gpio_info *tgi = bank->tgi;
232 + int gpio = d->hwirq;
233 +
234 ++ tegra_gpio_irq_mask(d);
235 + gpiochip_unlock_as_irq(&tgi->gc, gpio);
236 + }
237 +
238 +diff --git a/drivers/infiniband/hw/qib/qib_sysfs.c b/drivers/infiniband/hw/qib/qib_sysfs.c
239 +index 8ce0f6eef89e..b9d653afff8b 100644
240 +--- a/drivers/infiniband/hw/qib/qib_sysfs.c
241 ++++ b/drivers/infiniband/hw/qib/qib_sysfs.c
242 +@@ -756,7 +756,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
243 + qib_dev_err(dd,
244 + "Skipping linkcontrol sysfs info, (err %d) port %u\n",
245 + ret, port_num);
246 +- goto bail;
247 ++ goto bail_link;
248 + }
249 + kobject_uevent(&ppd->pport_kobj, KOBJ_ADD);
250 +
251 +@@ -766,7 +766,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
252 + qib_dev_err(dd,
253 + "Skipping sl2vl sysfs info, (err %d) port %u\n",
254 + ret, port_num);
255 +- goto bail_link;
256 ++ goto bail_sl;
257 + }
258 + kobject_uevent(&ppd->sl2vl_kobj, KOBJ_ADD);
259 +
260 +@@ -776,7 +776,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
261 + qib_dev_err(dd,
262 + "Skipping diag_counters sysfs info, (err %d) port %u\n",
263 + ret, port_num);
264 +- goto bail_sl;
265 ++ goto bail_diagc;
266 + }
267 + kobject_uevent(&ppd->diagc_kobj, KOBJ_ADD);
268 +
269 +@@ -789,7 +789,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
270 + qib_dev_err(dd,
271 + "Skipping Congestion Control sysfs info, (err %d) port %u\n",
272 + ret, port_num);
273 +- goto bail_diagc;
274 ++ goto bail_cc;
275 + }
276 +
277 + kobject_uevent(&ppd->pport_cc_kobj, KOBJ_ADD);
278 +@@ -871,6 +871,7 @@ void qib_verbs_unregister_sysfs(struct qib_devdata *dd)
279 + &cc_table_bin_attr);
280 + kobject_put(&ppd->pport_cc_kobj);
281 + }
282 ++ kobject_put(&ppd->diagc_kobj);
283 + kobject_put(&ppd->sl2vl_kobj);
284 + kobject_put(&ppd->pport_kobj);
285 + }
286 +diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
287 +index e9ae3d500a55..700f018df668 100644
288 +--- a/drivers/input/evdev.c
289 ++++ b/drivers/input/evdev.c
290 +@@ -342,20 +342,6 @@ static int evdev_fasync(int fd, struct file *file, int on)
291 + return fasync_helper(fd, file, on, &client->fasync);
292 + }
293 +
294 +-static int evdev_flush(struct file *file, fl_owner_t id)
295 +-{
296 +- struct evdev_client *client = file->private_data;
297 +- struct evdev *evdev = client->evdev;
298 +-
299 +- mutex_lock(&evdev->mutex);
300 +-
301 +- if (evdev->exist && !client->revoked)
302 +- input_flush_device(&evdev->handle, file);
303 +-
304 +- mutex_unlock(&evdev->mutex);
305 +- return 0;
306 +-}
307 +-
308 + static void evdev_free(struct device *dev)
309 + {
310 + struct evdev *evdev = container_of(dev, struct evdev, dev);
311 +@@ -469,6 +455,10 @@ static int evdev_release(struct inode *inode, struct file *file)
312 + unsigned int i;
313 +
314 + mutex_lock(&evdev->mutex);
315 ++
316 ++ if (evdev->exist && !client->revoked)
317 ++ input_flush_device(&evdev->handle, file);
318 ++
319 + evdev_ungrab(evdev, client);
320 + mutex_unlock(&evdev->mutex);
321 +
322 +@@ -1331,7 +1321,6 @@ static const struct file_operations evdev_fops = {
323 + .compat_ioctl = evdev_ioctl_compat,
324 + #endif
325 + .fasync = evdev_fasync,
326 +- .flush = evdev_flush,
327 + .llseek = no_llseek,
328 + };
329 +
330 +diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
331 +index 26476a64e663..54a6691d7d87 100644
332 +--- a/drivers/input/joystick/xpad.c
333 ++++ b/drivers/input/joystick/xpad.c
334 +@@ -475,6 +475,16 @@ static const u8 xboxone_fw2015_init[] = {
335 + 0x05, 0x20, 0x00, 0x01, 0x00
336 + };
337 +
338 ++/*
339 ++ * This packet is required for Xbox One S (0x045e:0x02ea)
340 ++ * and Xbox One Elite Series 2 (0x045e:0x0b00) pads to
341 ++ * initialize the controller that was previously used in
342 ++ * Bluetooth mode.
343 ++ */
344 ++static const u8 xboxone_s_init[] = {
345 ++ 0x05, 0x20, 0x00, 0x0f, 0x06
346 ++};
347 ++
348 + /*
349 + * This packet is required for the Titanfall 2 Xbox One pads
350 + * (0x0e6f:0x0165) to finish initialization and for Hori pads
351 +@@ -533,6 +543,8 @@ static const struct xboxone_init_packet xboxone_init_packets[] = {
352 + XBOXONE_INIT_PKT(0x0e6f, 0x0165, xboxone_hori_init),
353 + XBOXONE_INIT_PKT(0x0f0d, 0x0067, xboxone_hori_init),
354 + XBOXONE_INIT_PKT(0x0000, 0x0000, xboxone_fw2015_init),
355 ++ XBOXONE_INIT_PKT(0x045e, 0x02ea, xboxone_s_init),
356 ++ XBOXONE_INIT_PKT(0x045e, 0x0b00, xboxone_s_init),
357 + XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init1),
358 + XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init2),
359 + XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init),
360 +diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
361 +index 65038dcc7613..677edbf870a7 100644
362 +--- a/drivers/input/rmi4/rmi_driver.c
363 ++++ b/drivers/input/rmi4/rmi_driver.c
364 +@@ -991,7 +991,8 @@ static int rmi_driver_probe(struct device *dev)
365 + if (data->input) {
366 + rmi_driver_set_input_name(rmi_dev, data->input);
367 + if (!rmi_dev->xport->input) {
368 +- if (input_register_device(data->input)) {
369 ++ retval = input_register_device(data->input);
370 ++ if (retval) {
371 + dev_err(dev, "%s: Failed to register input device.\n",
372 + __func__);
373 + goto err_destroy_functions;
374 +diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
375 +index a4e76084a2af..fd1e79013cf8 100644
376 +--- a/drivers/input/serio/i8042-x86ia64io.h
377 ++++ b/drivers/input/serio/i8042-x86ia64io.h
378 +@@ -738,6 +738,13 @@ static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
379 + DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"),
380 + },
381 + },
382 ++ {
383 ++ /* Lenovo ThinkPad Twist S230u */
384 ++ .matches = {
385 ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
386 ++ DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"),
387 ++ },
388 ++ },
389 + { }
390 + };
391 +
392 +diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
393 +index 2c41107240de..499402a975b3 100644
394 +--- a/drivers/input/touchscreen/usbtouchscreen.c
395 ++++ b/drivers/input/touchscreen/usbtouchscreen.c
396 +@@ -197,6 +197,7 @@ static const struct usb_device_id usbtouch_devices[] = {
397 + #endif
398 +
399 + #ifdef CONFIG_TOUCHSCREEN_USB_IRTOUCH
400 ++ {USB_DEVICE(0x255e, 0x0001), .driver_info = DEVTYPE_IRTOUCH},
401 + {USB_DEVICE(0x595a, 0x0001), .driver_info = DEVTYPE_IRTOUCH},
402 + {USB_DEVICE(0x6615, 0x0001), .driver_info = DEVTYPE_IRTOUCH},
403 + {USB_DEVICE(0x6615, 0x0012), .driver_info = DEVTYPE_IRTOUCH_HIRES},
404 +diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
405 +index dbcc13efaf3c..d609e14bb904 100644
406 +--- a/drivers/iommu/iommu.c
407 ++++ b/drivers/iommu/iommu.c
408 +@@ -195,7 +195,7 @@ struct iommu_group *iommu_group_alloc(void)
409 + NULL, "%d", group->id);
410 + if (ret) {
411 + ida_simple_remove(&iommu_group_ida, group->id);
412 +- kfree(group);
413 ++ kobject_put(&group->kobj);
414 + return ERR_PTR(ret);
415 + }
416 +
417 +diff --git a/drivers/net/bonding/bond_sysfs_slave.c b/drivers/net/bonding/bond_sysfs_slave.c
418 +index 641a532b67cb..3f756fa2f603 100644
419 +--- a/drivers/net/bonding/bond_sysfs_slave.c
420 ++++ b/drivers/net/bonding/bond_sysfs_slave.c
421 +@@ -153,8 +153,10 @@ int bond_sysfs_slave_add(struct slave *slave)
422 +
423 + err = kobject_init_and_add(&slave->kobj, &slave_ktype,
424 + &(slave->dev->dev.kobj), "bonding_slave");
425 +- if (err)
426 ++ if (err) {
427 ++ kobject_put(&slave->kobj);
428 + return err;
429 ++ }
430 +
431 + for (a = slave_attrs; *a; ++a) {
432 + err = sysfs_create_file(&slave->kobj, &((*a)->attr));
433 +diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
434 +index 551b2a9ebf0f..4a4e86000192 100644
435 +--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
436 ++++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
437 +@@ -2867,6 +2867,9 @@ int hns_dsaf_roce_reset(struct fwnode_handle *dsaf_fwnode, bool dereset)
438 + dsaf_set_bit(credit, DSAF_SBM_ROCEE_CFG_CRD_EN_B, 1);
439 + dsaf_write_dev(dsaf_dev, DSAF_SBM_ROCEE_CFG_REG_REG, credit);
440 + }
441 ++
442 ++ put_device(&pdev->dev);
443 ++
444 + return 0;
445 + }
446 + EXPORT_SYMBOL(hns_dsaf_roce_reset);
447 +diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
448 +index 9af0887c8a29..fe9dc1b3078c 100644
449 +--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
450 ++++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
451 +@@ -2704,7 +2704,7 @@ void mlx4_opreq_action(struct work_struct *work)
452 + if (err) {
453 + mlx4_err(dev, "Failed to retrieve required operation: %d\n",
454 + err);
455 +- return;
456 ++ goto out;
457 + }
458 + MLX4_GET(modifier, outbox, GET_OP_REQ_MODIFIER_OFFSET);
459 + MLX4_GET(token, outbox, GET_OP_REQ_TOKEN_OFFSET);
460 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
461 +index bb142a13d9f2..b6113620cb1a 100644
462 +--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
463 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
464 +@@ -786,6 +786,7 @@ static void cmd_work_handler(struct work_struct *work)
465 + int alloc_ret;
466 + int cmd_mode;
467 +
468 ++ complete(&ent->handling);
469 + sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem;
470 + down(sem);
471 + if (!ent->page_queue) {
472 +@@ -904,6 +905,12 @@ static int wait_func(struct mlx5_core_dev *dev, struct mlx5_cmd_work_ent *ent)
473 + struct mlx5_cmd *cmd = &dev->cmd;
474 + int err;
475 +
476 ++ if (!wait_for_completion_timeout(&ent->handling, timeout) &&
477 ++ cancel_work_sync(&ent->work)) {
478 ++ ent->ret = -ECANCELED;
479 ++ goto out_err;
480 ++ }
481 ++
482 + if (cmd->mode == CMD_MODE_POLLING) {
483 + wait_for_completion(&ent->done);
484 + } else if (!wait_for_completion_timeout(&ent->done, timeout)) {
485 +@@ -911,12 +918,17 @@ static int wait_func(struct mlx5_core_dev *dev, struct mlx5_cmd_work_ent *ent)
486 + mlx5_cmd_comp_handler(dev, 1UL << ent->idx, true);
487 + }
488 +
489 ++out_err:
490 + err = ent->ret;
491 +
492 + if (err == -ETIMEDOUT) {
493 + mlx5_core_warn(dev, "%s(0x%x) timeout. Will cause a leak of a command resource\n",
494 + mlx5_command_str(msg_to_opcode(ent->in)),
495 + msg_to_opcode(ent->in));
496 ++ } else if (err == -ECANCELED) {
497 ++ mlx5_core_warn(dev, "%s(0x%x) canceled on out of queue timeout.\n",
498 ++ mlx5_command_str(msg_to_opcode(ent->in)),
499 ++ msg_to_opcode(ent->in));
500 + }
501 + mlx5_core_dbg(dev, "err %d, delivery status %s(%d)\n",
502 + err, deliv_status_to_str(ent->status), ent->status);
503 +@@ -951,6 +963,7 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *in,
504 +
505 + ent->token = token;
506 +
507 ++ init_completion(&ent->handling);
508 + if (!callback)
509 + init_completion(&ent->done);
510 +
511 +@@ -970,6 +983,8 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *in,
512 + err = wait_func(dev, ent);
513 + if (err == -ETIMEDOUT)
514 + goto out;
515 ++ if (err == -ECANCELED)
516 ++ goto out_free;
517 +
518 + ds = ent->ts2 - ent->ts1;
519 + op = MLX5_GET(mbox_in, in->first.data, opcode);
520 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
521 +index 574311018e6f..f0a6b72497da 100644
522 +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
523 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
524 +@@ -499,8 +499,9 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget)
525 + static void mlx5e_free_txq_sq_descs(struct mlx5e_sq *sq)
526 + {
527 + struct mlx5e_tx_wqe_info *wi;
528 ++ u32 nbytes = 0;
529 ++ u16 ci, npkts = 0;
530 + struct sk_buff *skb;
531 +- u16 ci;
532 + int i;
533 +
534 + while (sq->cc != sq->pc) {
535 +@@ -521,8 +522,11 @@ static void mlx5e_free_txq_sq_descs(struct mlx5e_sq *sq)
536 + }
537 +
538 + dev_kfree_skb_any(skb);
539 ++ npkts++;
540 ++ nbytes += wi->num_bytes;
541 + sq->cc += wi->num_wqebbs;
542 + }
543 ++ netdev_tx_completed_queue(sq->txq, npkts, nbytes);
544 + }
545 +
546 + static void mlx5e_free_xdp_sq_descs(struct mlx5e_sq *sq)
547 +diff --git a/drivers/net/ethernet/microchip/encx24j600.c b/drivers/net/ethernet/microchip/encx24j600.c
548 +index b14f0305aa31..ad661d1979c7 100644
549 +--- a/drivers/net/ethernet/microchip/encx24j600.c
550 ++++ b/drivers/net/ethernet/microchip/encx24j600.c
551 +@@ -1058,7 +1058,7 @@ static int encx24j600_spi_probe(struct spi_device *spi)
552 + if (unlikely(ret)) {
553 + netif_err(priv, probe, ndev, "Error %d initializing card encx24j600 card\n",
554 + ret);
555 +- goto out_free;
556 ++ goto out_stop;
557 + }
558 +
559 + eidled = encx24j600_read_reg(priv, EIDLED);
560 +@@ -1076,6 +1076,8 @@ static int encx24j600_spi_probe(struct spi_device *spi)
561 +
562 + out_unregister:
563 + unregister_netdev(priv->ndev);
564 ++out_stop:
565 ++ kthread_stop(priv->kworker_task);
566 + out_free:
567 + free_netdev(ndev);
568 +
569 +@@ -1088,6 +1090,7 @@ static int encx24j600_spi_remove(struct spi_device *spi)
570 + struct encx24j600_priv *priv = dev_get_drvdata(&spi->dev);
571 +
572 + unregister_netdev(priv->ndev);
573 ++ kthread_stop(priv->kworker_task);
574 +
575 + free_netdev(priv->ndev);
576 +
577 +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
578 +index 35c5ac41c0a1..5d2de48b77a0 100644
579 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
580 ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
581 +@@ -3610,7 +3610,7 @@ int qlcnic_83xx_interrupt_test(struct net_device *netdev)
582 + ahw->diag_cnt = 0;
583 + ret = qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_INTRPT_TEST);
584 + if (ret)
585 +- goto fail_diag_irq;
586 ++ goto fail_mbx_args;
587 +
588 + if (adapter->flags & QLCNIC_MSIX_ENABLED)
589 + intrpt_id = ahw->intr_tbl[0].id;
590 +@@ -3640,6 +3640,8 @@ int qlcnic_83xx_interrupt_test(struct net_device *netdev)
591 +
592 + done:
593 + qlcnic_free_mbx_args(&cmd);
594 ++
595 ++fail_mbx_args:
596 + qlcnic_83xx_diag_free_res(netdev, drv_sds_rings);
597 +
598 + fail_diag_irq:
599 +diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c
600 +index 062bce9acde6..bfe7b55f9714 100644
601 +--- a/drivers/net/ethernet/sun/cassini.c
602 ++++ b/drivers/net/ethernet/sun/cassini.c
603 +@@ -4980,7 +4980,7 @@ static int cas_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
604 + cas_cacheline_size)) {
605 + dev_err(&pdev->dev, "Could not set PCI cache "
606 + "line size\n");
607 +- goto err_write_cacheline;
608 ++ goto err_out_free_res;
609 + }
610 + }
611 + #endif
612 +@@ -5151,7 +5151,6 @@ err_out_iounmap:
613 + err_out_free_res:
614 + pci_release_regions(pdev);
615 +
616 +-err_write_cacheline:
617 + /* Try to restore it in case the error occurred after we
618 + * set it.
619 + */
620 +diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
621 +index a3aaef4c53a3..0d2bcb33697f 100644
622 +--- a/drivers/s390/scsi/zfcp_fsf.c
623 ++++ b/drivers/s390/scsi/zfcp_fsf.c
624 +@@ -1594,6 +1594,7 @@ int zfcp_fsf_open_wka_port(struct zfcp_fc_wka_port *wka_port)
625 + {
626 + struct zfcp_qdio *qdio = wka_port->adapter->qdio;
627 + struct zfcp_fsf_req *req;
628 ++ unsigned long req_id = 0;
629 + int retval = -EIO;
630 +
631 + spin_lock_irq(&qdio->req_q_lock);
632 +@@ -1616,6 +1617,8 @@ int zfcp_fsf_open_wka_port(struct zfcp_fc_wka_port *wka_port)
633 + hton24(req->qtcb->bottom.support.d_id, wka_port->d_id);
634 + req->data = wka_port;
635 +
636 ++ req_id = req->req_id;
637 ++
638 + zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT);
639 + retval = zfcp_fsf_req_send(req);
640 + if (retval)
641 +@@ -1623,7 +1626,7 @@ int zfcp_fsf_open_wka_port(struct zfcp_fc_wka_port *wka_port)
642 + out:
643 + spin_unlock_irq(&qdio->req_q_lock);
644 + if (!retval)
645 +- zfcp_dbf_rec_run_wka("fsowp_1", wka_port, req->req_id);
646 ++ zfcp_dbf_rec_run_wka("fsowp_1", wka_port, req_id);
647 + return retval;
648 + }
649 +
650 +@@ -1649,6 +1652,7 @@ int zfcp_fsf_close_wka_port(struct zfcp_fc_wka_port *wka_port)
651 + {
652 + struct zfcp_qdio *qdio = wka_port->adapter->qdio;
653 + struct zfcp_fsf_req *req;
654 ++ unsigned long req_id = 0;
655 + int retval = -EIO;
656 +
657 + spin_lock_irq(&qdio->req_q_lock);
658 +@@ -1671,6 +1675,8 @@ int zfcp_fsf_close_wka_port(struct zfcp_fc_wka_port *wka_port)
659 + req->data = wka_port;
660 + req->qtcb->header.port_handle = wka_port->handle;
661 +
662 ++ req_id = req->req_id;
663 ++
664 + zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT);
665 + retval = zfcp_fsf_req_send(req);
666 + if (retval)
667 +@@ -1678,7 +1684,7 @@ int zfcp_fsf_close_wka_port(struct zfcp_fc_wka_port *wka_port)
668 + out:
669 + spin_unlock_irq(&qdio->req_q_lock);
670 + if (!retval)
671 +- zfcp_dbf_rec_run_wka("fscwp_1", wka_port, req->req_id);
672 ++ zfcp_dbf_rec_run_wka("fscwp_1", wka_port, req_id);
673 + return retval;
674 + }
675 +
676 +diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
677 +index f80a88d107d7..d8843657d787 100644
678 +--- a/drivers/tty/serial/sc16is7xx.c
679 ++++ b/drivers/tty/serial/sc16is7xx.c
680 +@@ -1523,10 +1523,12 @@ static int __init sc16is7xx_init(void)
681 + #endif
682 + return ret;
683 +
684 ++#ifdef CONFIG_SERIAL_SC16IS7XX_SPI
685 + err_spi:
686 + #ifdef CONFIG_SERIAL_SC16IS7XX_I2C
687 + i2c_del_driver(&sc16is7xx_i2c_uart_driver);
688 + #endif
689 ++#endif
690 + err_i2c:
691 + uart_unregister_driver(&sc16is7xx_uart);
692 + return ret;
693 +diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
694 +index b8534d3f8bb0..cb02e9ecd8e7 100644
695 +--- a/drivers/usb/gadget/legacy/inode.c
696 ++++ b/drivers/usb/gadget/legacy/inode.c
697 +@@ -1364,7 +1364,6 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
698 +
699 + req->buf = dev->rbuf;
700 + req->context = NULL;
701 +- value = -EOPNOTSUPP;
702 + switch (ctrl->bRequest) {
703 +
704 + case USB_REQ_GET_DESCRIPTOR:
705 +@@ -1788,7 +1787,7 @@ static ssize_t
706 + dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
707 + {
708 + struct dev_data *dev = fd->private_data;
709 +- ssize_t value = len, length = len;
710 ++ ssize_t value, length = len;
711 + unsigned total;
712 + u32 tag;
713 + char *kbuf;
714 +diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
715 +index e78553d51837..73cd7482c1fa 100644
716 +--- a/fs/binfmt_elf.c
717 ++++ b/fs/binfmt_elf.c
718 +@@ -1721,7 +1721,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
719 + (!regset->active || regset->active(t->task, regset) > 0)) {
720 + int ret;
721 + size_t size = regset->n * regset->size;
722 +- void *data = kmalloc(size, GFP_KERNEL);
723 ++ void *data = kzalloc(size, GFP_KERNEL);
724 + if (unlikely(!data))
725 + return 0;
726 + ret = regset->get(t->task, regset,
727 +diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
728 +index 799b59d96fe2..7dba96d5fef1 100644
729 +--- a/fs/cachefiles/rdwr.c
730 ++++ b/fs/cachefiles/rdwr.c
731 +@@ -64,9 +64,9 @@ static int cachefiles_read_waiter(wait_queue_t *wait, unsigned mode,
732 + object = container_of(op->op.object, struct cachefiles_object, fscache);
733 + spin_lock(&object->work_lock);
734 + list_add_tail(&monitor->op_link, &op->to_do);
735 ++ fscache_enqueue_retrieval(op);
736 + spin_unlock(&object->work_lock);
737 +
738 +- fscache_enqueue_retrieval(op);
739 + fscache_put_retrieval(op);
740 + return 0;
741 + }
742 +diff --git a/fs/cifs/file.c b/fs/cifs/file.c
743 +index 09d83275c20b..b2919166855f 100644
744 +--- a/fs/cifs/file.c
745 ++++ b/fs/cifs/file.c
746 +@@ -3293,7 +3293,7 @@ cifs_read(struct file *file, char *read_data, size_t read_size, loff_t *offset)
747 + * than it negotiated since it will refuse the read
748 + * then.
749 + */
750 +- if ((tcon->ses) && !(tcon->ses->capabilities &
751 ++ if (!(tcon->ses->capabilities &
752 + tcon->ses->server->vals->cap_large_files)) {
753 + current_read_size = min_t(uint,
754 + current_read_size, CIFSMaxBufSize);
755 +diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
756 +index c2ca9566b764..fb9b1d702351 100644
757 +--- a/fs/gfs2/quota.c
758 ++++ b/fs/gfs2/quota.c
759 +@@ -1039,8 +1039,7 @@ int gfs2_quota_lock(struct gfs2_inode *ip, kuid_t uid, kgid_t gid)
760 + u32 x;
761 + int error = 0;
762 +
763 +- if (capable(CAP_SYS_RESOURCE) ||
764 +- sdp->sd_args.ar_quota != GFS2_QUOTA_ON)
765 ++ if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON)
766 + return 0;
767 +
768 + error = gfs2_quota_hold(ip, uid, gid);
769 +diff --git a/fs/gfs2/quota.h b/fs/gfs2/quota.h
770 +index 836f29480be6..e3a6e2404d11 100644
771 +--- a/fs/gfs2/quota.h
772 ++++ b/fs/gfs2/quota.h
773 +@@ -47,7 +47,8 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip,
774 + int ret;
775 +
776 + ap->allowed = UINT_MAX; /* Assume we are permitted a whole lot */
777 +- if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
778 ++ if (capable(CAP_SYS_RESOURCE) ||
779 ++ sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
780 + return 0;
781 + ret = gfs2_quota_lock(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE);
782 + if (ret)
783 +diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h
784 +index 5d2add1a6c96..864fcfa1df41 100644
785 +--- a/include/asm-generic/topology.h
786 ++++ b/include/asm-generic/topology.h
787 +@@ -51,7 +51,7 @@
788 + #ifdef CONFIG_NEED_MULTIPLE_NODES
789 + #define cpumask_of_node(node) ((node) == 0 ? cpu_online_mask : cpu_none_mask)
790 + #else
791 +- #define cpumask_of_node(node) ((void)node, cpu_online_mask)
792 ++ #define cpumask_of_node(node) ((void)(node), cpu_online_mask)
793 + #endif
794 + #endif
795 + #ifndef pcibus_to_node
796 +diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
797 +index 509e99076c57..6094e4a3a0a4 100644
798 +--- a/include/linux/mlx5/driver.h
799 ++++ b/include/linux/mlx5/driver.h
800 +@@ -656,6 +656,7 @@ struct mlx5_cmd_work_ent {
801 + struct delayed_work cb_timeout_work;
802 + void *context;
803 + int idx;
804 ++ struct completion handling;
805 + struct completion done;
806 + struct mlx5_cmd *cmd;
807 + struct work_struct work;
808 +diff --git a/include/linux/mm.h b/include/linux/mm.h
809 +index ca6f213fa4f0..7a4c035b187f 100644
810 +--- a/include/linux/mm.h
811 ++++ b/include/linux/mm.h
812 +@@ -504,6 +504,11 @@ static inline int is_vmalloc_or_module_addr(const void *x)
813 +
814 + extern void kvfree(const void *addr);
815 +
816 ++/*
817 ++ * Mapcount of compound page as a whole, does not include mapped sub-pages.
818 ++ *
819 ++ * Must be called only for compound pages or any their tail sub-pages.
820 ++ */
821 + static inline int compound_mapcount(struct page *page)
822 + {
823 + VM_BUG_ON_PAGE(!PageCompound(page), page);
824 +@@ -523,10 +528,16 @@ static inline void page_mapcount_reset(struct page *page)
825 +
826 + int __page_mapcount(struct page *page);
827 +
828 ++/*
829 ++ * Mapcount of 0-order page; when compound sub-page, includes
830 ++ * compound_mapcount().
831 ++ *
832 ++ * Result is undefined for pages which cannot be mapped into userspace.
833 ++ * For example SLAB or special types of pages. See function page_has_type().
834 ++ * They use this place in struct page differently.
835 ++ */
836 + static inline int page_mapcount(struct page *page)
837 + {
838 +- VM_BUG_ON_PAGE(PageSlab(page), page);
839 +-
840 + if (unlikely(PageCompound(page)))
841 + return __page_mapcount(page);
842 + return atomic_read(&page->_mapcount) + 1;
843 +diff --git a/include/linux/netfilter/nf_conntrack_pptp.h b/include/linux/netfilter/nf_conntrack_pptp.h
844 +index 2ab2830316b7..aca42a2e79cf 100644
845 +--- a/include/linux/netfilter/nf_conntrack_pptp.h
846 ++++ b/include/linux/netfilter/nf_conntrack_pptp.h
847 +@@ -4,7 +4,7 @@
848 +
849 + #include <linux/netfilter/nf_conntrack_common.h>
850 +
851 +-extern const char *const pptp_msg_name[];
852 ++const char *pptp_msg_name(u_int16_t msg);
853 +
854 + /* state of the control session */
855 + enum pptp_ctrlsess_state {
856 +diff --git a/include/net/act_api.h b/include/net/act_api.h
857 +index 82f3c912a5b1..051b90779708 100644
858 +--- a/include/net/act_api.h
859 ++++ b/include/net/act_api.h
860 +@@ -94,7 +94,8 @@ static inline void tcf_tm_dump(struct tcf_t *dtm, const struct tcf_t *stm)
861 + {
862 + dtm->install = jiffies_to_clock_t(jiffies - stm->install);
863 + dtm->lastuse = jiffies_to_clock_t(jiffies - stm->lastuse);
864 +- dtm->firstuse = jiffies_to_clock_t(jiffies - stm->firstuse);
865 ++ dtm->firstuse = stm->firstuse ?
866 ++ jiffies_to_clock_t(jiffies - stm->firstuse) : 0;
867 + dtm->expires = jiffies_to_clock_t(stm->expires);
868 + }
869 +
870 +diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
871 +index f888263fd757..f4205f935331 100644
872 +--- a/include/rdma/ib_addr.h
873 ++++ b/include/rdma/ib_addr.h
874 +@@ -208,11 +208,13 @@ static inline void iboe_addr_get_sgid(struct rdma_dev_addr *dev_addr,
875 + dev = dev_get_by_index(&init_net, dev_addr->bound_dev_if);
876 + if (dev) {
877 + ip4 = in_dev_get(dev);
878 +- if (ip4 && ip4->ifa_list && ip4->ifa_list->ifa_address) {
879 ++ if (ip4 && ip4->ifa_list && ip4->ifa_list->ifa_address)
880 + ipv6_addr_set_v4mapped(ip4->ifa_list->ifa_address,
881 + (struct in6_addr *)gid);
882 ++
883 ++ if (ip4)
884 + in_dev_put(ip4);
885 +- }
886 ++
887 + dev_put(dev);
888 + }
889 + }
890 +diff --git a/include/uapi/linux/l2tp.h b/include/uapi/linux/l2tp.h
891 +index bb2d62037037..80d85053fb06 100644
892 +--- a/include/uapi/linux/l2tp.h
893 ++++ b/include/uapi/linux/l2tp.h
894 +@@ -9,9 +9,8 @@
895 +
896 + #include <linux/types.h>
897 + #include <linux/socket.h>
898 +-#ifndef __KERNEL__
899 +-#include <netinet/in.h>
900 +-#endif
901 ++#include <linux/in.h>
902 ++#include <linux/in6.h>
903 +
904 + #define IPPROTO_L2TP 115
905 +
906 +@@ -31,7 +30,7 @@ struct sockaddr_l2tpip {
907 + __u32 l2tp_conn_id; /* Connection ID of tunnel */
908 +
909 + /* Pad to size of `struct sockaddr'. */
910 +- unsigned char __pad[sizeof(struct sockaddr) -
911 ++ unsigned char __pad[__SOCK_SIZE__ -
912 + sizeof(__kernel_sa_family_t) -
913 + sizeof(__be16) - sizeof(struct in_addr) -
914 + sizeof(__u32)];
915 +diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c
916 +index 37ddb7bda651..ec7c7eda0774 100644
917 +--- a/kernel/irq/migration.c
918 ++++ b/kernel/irq/migration.c
919 +@@ -7,17 +7,18 @@
920 + void irq_move_masked_irq(struct irq_data *idata)
921 + {
922 + struct irq_desc *desc = irq_data_to_desc(idata);
923 +- struct irq_chip *chip = desc->irq_data.chip;
924 ++ struct irq_data *data = &desc->irq_data;
925 ++ struct irq_chip *chip = data->chip;
926 +
927 +- if (likely(!irqd_is_setaffinity_pending(&desc->irq_data)))
928 ++ if (likely(!irqd_is_setaffinity_pending(data)))
929 + return;
930 +
931 +- irqd_clr_move_pending(&desc->irq_data);
932 ++ irqd_clr_move_pending(data);
933 +
934 + /*
935 + * Paranoia: cpu-local interrupts shouldn't be calling in here anyway.
936 + */
937 +- if (irqd_is_per_cpu(&desc->irq_data)) {
938 ++ if (irqd_is_per_cpu(data)) {
939 + WARN_ON(1);
940 + return;
941 + }
942 +@@ -42,9 +43,20 @@ void irq_move_masked_irq(struct irq_data *idata)
943 + * For correct operation this depends on the caller
944 + * masking the irqs.
945 + */
946 +- if (cpumask_any_and(desc->pending_mask, cpu_online_mask) < nr_cpu_ids)
947 +- irq_do_set_affinity(&desc->irq_data, desc->pending_mask, false);
948 +-
949 ++ if (cpumask_any_and(desc->pending_mask, cpu_online_mask) < nr_cpu_ids) {
950 ++ int ret;
951 ++
952 ++ ret = irq_do_set_affinity(data, desc->pending_mask, false);
953 ++ /*
954 ++ * If the there is a cleanup pending in the underlying
955 ++ * vector management, reschedule the move for the next
956 ++ * interrupt. Leave desc->pending_mask intact.
957 ++ */
958 ++ if (ret == -EBUSY) {
959 ++ irqd_set_move_pending(data);
960 ++ return;
961 ++ }
962 ++ }
963 + cpumask_clear(desc->pending_mask);
964 + }
965 +
966 +diff --git a/mm/vmalloc.c b/mm/vmalloc.c
967 +index c74a087fcb7d..5d11aeceb7f8 100644
968 +--- a/mm/vmalloc.c
969 ++++ b/mm/vmalloc.c
970 +@@ -1499,7 +1499,7 @@ static void __vunmap(const void *addr, int deallocate_pages)
971 + addr))
972 + return;
973 +
974 +- area = find_vmap_area((unsigned long)addr)->vm;
975 ++ area = find_vm_area(addr);
976 + if (unlikely(!area)) {
977 + WARN(1, KERN_ERR "Trying to vfree() nonexistent vm area (%p)\n",
978 + addr);
979 +diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
980 +index de55a3f001dc..02be8ee23271 100644
981 +--- a/net/ax25/af_ax25.c
982 ++++ b/net/ax25/af_ax25.c
983 +@@ -639,8 +639,10 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
984 + break;
985 +
986 + case SO_BINDTODEVICE:
987 +- if (optlen > IFNAMSIZ)
988 +- optlen = IFNAMSIZ;
989 ++ if (optlen > IFNAMSIZ - 1)
990 ++ optlen = IFNAMSIZ - 1;
991 ++
992 ++ memset(devname, 0, sizeof(devname));
993 +
994 + if (copy_from_user(devname, optval, optlen)) {
995 + res = -EFAULT;
996 +diff --git a/net/bridge/netfilter/nft_reject_bridge.c b/net/bridge/netfilter/nft_reject_bridge.c
997 +index d94aaf7c7685..4b5e1a661317 100644
998 +--- a/net/bridge/netfilter/nft_reject_bridge.c
999 ++++ b/net/bridge/netfilter/nft_reject_bridge.c
1000 +@@ -34,6 +34,12 @@ static void nft_reject_br_push_etherhdr(struct sk_buff *oldskb,
1001 + ether_addr_copy(eth->h_dest, eth_hdr(oldskb)->h_source);
1002 + eth->h_proto = eth_hdr(oldskb)->h_proto;
1003 + skb_pull(nskb, ETH_HLEN);
1004 ++
1005 ++ if (skb_vlan_tag_present(oldskb)) {
1006 ++ u16 vid = skb_vlan_tag_get(oldskb);
1007 ++
1008 ++ __vlan_hwaccel_put_tag(nskb, oldskb->vlan_proto, vid);
1009 ++ }
1010 + }
1011 +
1012 + static int nft_bridge_iphdr_validate(struct sk_buff *skb)
1013 +diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
1014 +index 70ccb0716fc5..4fd679b30b19 100644
1015 +--- a/net/ceph/osd_client.c
1016 ++++ b/net/ceph/osd_client.c
1017 +@@ -2879,7 +2879,9 @@ static void handle_reply(struct ceph_osd *osd, struct ceph_msg *msg)
1018 + * supported.
1019 + */
1020 + req->r_t.target_oloc.pool = m.redirect.oloc.pool;
1021 +- req->r_flags |= CEPH_OSD_FLAG_REDIRECTED;
1022 ++ req->r_flags |= CEPH_OSD_FLAG_REDIRECTED |
1023 ++ CEPH_OSD_FLAG_IGNORE_OVERLAY |
1024 ++ CEPH_OSD_FLAG_IGNORE_CACHE;
1025 + req->r_tid = 0;
1026 + __submit_request(req, false);
1027 + goto out_unlock_osdc;
1028 +diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
1029 +index ead1a32c68f7..e652e376fb30 100644
1030 +--- a/net/core/rtnetlink.c
1031 ++++ b/net/core/rtnetlink.c
1032 +@@ -2361,7 +2361,7 @@ int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm)
1033 + }
1034 +
1035 + if (dev->rtnl_link_state == RTNL_LINK_INITIALIZED) {
1036 +- __dev_notify_flags(dev, old_flags, 0U);
1037 ++ __dev_notify_flags(dev, old_flags, (old_flags ^ dev->flags));
1038 + } else {
1039 + dev->rtnl_link_state = RTNL_LINK_INITIALIZED;
1040 + __dev_notify_flags(dev, old_flags, ~0U);
1041 +diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c
1042 +index 8afb67a48409..dc3b36ca9f30 100644
1043 +--- a/net/ipv4/ip_vti.c
1044 ++++ b/net/ipv4/ip_vti.c
1045 +@@ -50,7 +50,7 @@ static int vti_net_id __read_mostly;
1046 + static int vti_tunnel_init(struct net_device *dev);
1047 +
1048 + static int vti_input(struct sk_buff *skb, int nexthdr, __be32 spi,
1049 +- int encap_type)
1050 ++ int encap_type, bool update_skb_dev)
1051 + {
1052 + struct ip_tunnel *tunnel;
1053 + const struct iphdr *iph = ip_hdr(skb);
1054 +@@ -65,6 +65,9 @@ static int vti_input(struct sk_buff *skb, int nexthdr, __be32 spi,
1055 +
1056 + XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4 = tunnel;
1057 +
1058 ++ if (update_skb_dev)
1059 ++ skb->dev = tunnel->dev;
1060 ++
1061 + return xfrm_input(skb, nexthdr, spi, encap_type);
1062 + }
1063 +
1064 +@@ -74,25 +77,43 @@ drop:
1065 + return 0;
1066 + }
1067 +
1068 +-static int vti_input_ipip(struct sk_buff *skb, int nexthdr, __be32 spi,
1069 +- int encap_type)
1070 ++static int vti_input_proto(struct sk_buff *skb, int nexthdr, __be32 spi,
1071 ++ int encap_type)
1072 + {
1073 +- struct ip_tunnel *tunnel;
1074 ++ return vti_input(skb, nexthdr, spi, encap_type, false);
1075 ++}
1076 ++
1077 ++static int vti_rcv(struct sk_buff *skb, __be32 spi, bool update_skb_dev)
1078 ++{
1079 ++ XFRM_SPI_SKB_CB(skb)->family = AF_INET;
1080 ++ XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct iphdr, daddr);
1081 ++
1082 ++ return vti_input(skb, ip_hdr(skb)->protocol, spi, 0, update_skb_dev);
1083 ++}
1084 ++
1085 ++static int vti_rcv_proto(struct sk_buff *skb)
1086 ++{
1087 ++ return vti_rcv(skb, 0, false);
1088 ++}
1089 ++
1090 ++static int vti_rcv_tunnel(struct sk_buff *skb)
1091 ++{
1092 ++ struct ip_tunnel_net *itn = net_generic(dev_net(skb->dev), vti_net_id);
1093 + const struct iphdr *iph = ip_hdr(skb);
1094 +- struct net *net = dev_net(skb->dev);
1095 +- struct ip_tunnel_net *itn = net_generic(net, vti_net_id);
1096 ++ struct ip_tunnel *tunnel;
1097 +
1098 + tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, TUNNEL_NO_KEY,
1099 + iph->saddr, iph->daddr, 0);
1100 + if (tunnel) {
1101 ++ struct tnl_ptk_info tpi = {
1102 ++ .proto = htons(ETH_P_IP),
1103 ++ };
1104 ++
1105 + if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb))
1106 + goto drop;
1107 +-
1108 +- XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4 = tunnel;
1109 +-
1110 +- skb->dev = tunnel->dev;
1111 +-
1112 +- return xfrm_input(skb, nexthdr, spi, encap_type);
1113 ++ if (iptunnel_pull_header(skb, 0, tpi.proto, false))
1114 ++ goto drop;
1115 ++ return ip_tunnel_rcv(tunnel, skb, &tpi, NULL, false);
1116 + }
1117 +
1118 + return -EINVAL;
1119 +@@ -101,22 +122,6 @@ drop:
1120 + return 0;
1121 + }
1122 +
1123 +-static int vti_rcv(struct sk_buff *skb)
1124 +-{
1125 +- XFRM_SPI_SKB_CB(skb)->family = AF_INET;
1126 +- XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct iphdr, daddr);
1127 +-
1128 +- return vti_input(skb, ip_hdr(skb)->protocol, 0, 0);
1129 +-}
1130 +-
1131 +-static int vti_rcv_ipip(struct sk_buff *skb)
1132 +-{
1133 +- XFRM_SPI_SKB_CB(skb)->family = AF_INET;
1134 +- XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct iphdr, daddr);
1135 +-
1136 +- return vti_input_ipip(skb, ip_hdr(skb)->protocol, ip_hdr(skb)->saddr, 0);
1137 +-}
1138 +-
1139 + static int vti_rcv_cb(struct sk_buff *skb, int err)
1140 + {
1141 + unsigned short family;
1142 +@@ -482,31 +487,31 @@ static void __net_init vti_fb_tunnel_init(struct net_device *dev)
1143 + }
1144 +
1145 + static struct xfrm4_protocol vti_esp4_protocol __read_mostly = {
1146 +- .handler = vti_rcv,
1147 +- .input_handler = vti_input,
1148 ++ .handler = vti_rcv_proto,
1149 ++ .input_handler = vti_input_proto,
1150 + .cb_handler = vti_rcv_cb,
1151 + .err_handler = vti4_err,
1152 + .priority = 100,
1153 + };
1154 +
1155 + static struct xfrm4_protocol vti_ah4_protocol __read_mostly = {
1156 +- .handler = vti_rcv,
1157 +- .input_handler = vti_input,
1158 ++ .handler = vti_rcv_proto,
1159 ++ .input_handler = vti_input_proto,
1160 + .cb_handler = vti_rcv_cb,
1161 + .err_handler = vti4_err,
1162 + .priority = 100,
1163 + };
1164 +
1165 + static struct xfrm4_protocol vti_ipcomp4_protocol __read_mostly = {
1166 +- .handler = vti_rcv,
1167 +- .input_handler = vti_input,
1168 ++ .handler = vti_rcv_proto,
1169 ++ .input_handler = vti_input_proto,
1170 + .cb_handler = vti_rcv_cb,
1171 + .err_handler = vti4_err,
1172 + .priority = 100,
1173 + };
1174 +
1175 + static struct xfrm_tunnel ipip_handler __read_mostly = {
1176 +- .handler = vti_rcv_ipip,
1177 ++ .handler = vti_rcv_tunnel,
1178 + .err_handler = vti4_err,
1179 + .priority = 0,
1180 + };
1181 +diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
1182 +index 56d71a004dce..bd23a2d01b6c 100644
1183 +--- a/net/ipv4/ipip.c
1184 ++++ b/net/ipv4/ipip.c
1185 +@@ -689,7 +689,7 @@ out:
1186 +
1187 + rtnl_link_failed:
1188 + #if IS_ENABLED(CONFIG_MPLS)
1189 +- xfrm4_tunnel_deregister(&mplsip_handler, AF_INET);
1190 ++ xfrm4_tunnel_deregister(&mplsip_handler, AF_MPLS);
1191 + xfrm_tunnel_mplsip_failed:
1192 +
1193 + #endif
1194 +diff --git a/net/ipv4/netfilter/nf_nat_pptp.c b/net/ipv4/netfilter/nf_nat_pptp.c
1195 +index b3ca21b2ba9b..ddbf93e70069 100644
1196 +--- a/net/ipv4/netfilter/nf_nat_pptp.c
1197 ++++ b/net/ipv4/netfilter/nf_nat_pptp.c
1198 +@@ -156,8 +156,7 @@ pptp_outbound_pkt(struct sk_buff *skb,
1199 + break;
1200 + default:
1201 + pr_debug("unknown outbound packet 0x%04x:%s\n", msg,
1202 +- msg <= PPTP_MSG_MAX ? pptp_msg_name[msg] :
1203 +- pptp_msg_name[0]);
1204 ++ pptp_msg_name(msg));
1205 + /* fall through */
1206 + case PPTP_SET_LINK_INFO:
1207 + /* only need to NAT in case PAC is behind NAT box */
1208 +@@ -250,9 +249,7 @@ pptp_inbound_pkt(struct sk_buff *skb,
1209 + pcid_off = offsetof(union pptp_ctrl_union, setlink.peersCallID);
1210 + break;
1211 + default:
1212 +- pr_debug("unknown inbound packet %s\n",
1213 +- msg <= PPTP_MSG_MAX ? pptp_msg_name[msg] :
1214 +- pptp_msg_name[0]);
1215 ++ pr_debug("unknown inbound packet %s\n", pptp_msg_name(msg));
1216 + /* fall through */
1217 + case PPTP_START_SESSION_REQUEST:
1218 + case PPTP_START_SESSION_REPLY:
1219 +diff --git a/net/ipv4/route.c b/net/ipv4/route.c
1220 +index 81efd2d3998d..c8c51bd2d695 100644
1221 +--- a/net/ipv4/route.c
1222 ++++ b/net/ipv4/route.c
1223 +@@ -477,18 +477,16 @@ u32 ip_idents_reserve(u32 hash, int segs)
1224 + atomic_t *p_id = ip_idents + hash % IP_IDENTS_SZ;
1225 + u32 old = ACCESS_ONCE(*p_tstamp);
1226 + u32 now = (u32)jiffies;
1227 +- u32 new, delta = 0;
1228 ++ u32 delta = 0;
1229 +
1230 + if (old != now && cmpxchg(p_tstamp, old, now) == old)
1231 + delta = prandom_u32_max(now - old);
1232 +
1233 +- /* Do not use atomic_add_return() as it makes UBSAN unhappy */
1234 +- do {
1235 +- old = (u32)atomic_read(p_id);
1236 +- new = old + delta + segs;
1237 +- } while (atomic_cmpxchg(p_id, old, new) != old);
1238 +-
1239 +- return new - segs;
1240 ++ /* If UBSAN reports an error there, please make sure your compiler
1241 ++ * supports -fno-strict-overflow before reporting it that was a bug
1242 ++ * in UBSAN, and it has been fixed in GCC-8.
1243 ++ */
1244 ++ return atomic_add_return(segs + delta, p_id) - segs;
1245 + }
1246 + EXPORT_SYMBOL(ip_idents_reserve);
1247 +
1248 +diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
1249 +index f7eaa1051b5b..2fbd100b9e73 100644
1250 +--- a/net/mac80211/mesh_hwmp.c
1251 ++++ b/net/mac80211/mesh_hwmp.c
1252 +@@ -1082,7 +1082,14 @@ void mesh_path_start_discovery(struct ieee80211_sub_if_data *sdata)
1253 + mesh_path_sel_frame_tx(MPATH_PREQ, 0, sdata->vif.addr, ifmsh->sn,
1254 + target_flags, mpath->dst, mpath->sn, da, 0,
1255 + ttl, lifetime, 0, ifmsh->preq_id++, sdata);
1256 ++
1257 ++ spin_lock_bh(&mpath->state_lock);
1258 ++ if (mpath->flags & MESH_PATH_DELETED) {
1259 ++ spin_unlock_bh(&mpath->state_lock);
1260 ++ goto enddiscovery;
1261 ++ }
1262 + mod_timer(&mpath->timer, jiffies + mpath->discovery_timeout);
1263 ++ spin_unlock_bh(&mpath->state_lock);
1264 +
1265 + enddiscovery:
1266 + rcu_read_unlock();
1267 +diff --git a/net/netfilter/ipset/ip_set_list_set.c b/net/netfilter/ipset/ip_set_list_set.c
1268 +index e82157285d34..f13d40402f7e 100644
1269 +--- a/net/netfilter/ipset/ip_set_list_set.c
1270 ++++ b/net/netfilter/ipset/ip_set_list_set.c
1271 +@@ -61,7 +61,7 @@ list_set_ktest(struct ip_set *set, const struct sk_buff *skb,
1272 + /* Don't lookup sub-counters at all */
1273 + opt->cmdflags &= ~IPSET_FLAG_MATCH_COUNTERS;
1274 + if (opt->cmdflags & IPSET_FLAG_SKIP_SUBCOUNTER_UPDATE)
1275 +- opt->cmdflags &= ~IPSET_FLAG_SKIP_COUNTER_UPDATE;
1276 ++ opt->cmdflags |= IPSET_FLAG_SKIP_COUNTER_UPDATE;
1277 + list_for_each_entry_rcu(e, &map->members, list) {
1278 + if (SET_WITH_TIMEOUT(set) &&
1279 + ip_set_timeout_expired(ext_timeout(e, set)))
1280 +diff --git a/net/netfilter/nf_conntrack_pptp.c b/net/netfilter/nf_conntrack_pptp.c
1281 +index f60a4755d71e..1b2fa9d8575f 100644
1282 +--- a/net/netfilter/nf_conntrack_pptp.c
1283 ++++ b/net/netfilter/nf_conntrack_pptp.c
1284 +@@ -71,24 +71,32 @@ EXPORT_SYMBOL_GPL(nf_nat_pptp_hook_expectfn);
1285 +
1286 + #if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
1287 + /* PptpControlMessageType names */
1288 +-const char *const pptp_msg_name[] = {
1289 +- "UNKNOWN_MESSAGE",
1290 +- "START_SESSION_REQUEST",
1291 +- "START_SESSION_REPLY",
1292 +- "STOP_SESSION_REQUEST",
1293 +- "STOP_SESSION_REPLY",
1294 +- "ECHO_REQUEST",
1295 +- "ECHO_REPLY",
1296 +- "OUT_CALL_REQUEST",
1297 +- "OUT_CALL_REPLY",
1298 +- "IN_CALL_REQUEST",
1299 +- "IN_CALL_REPLY",
1300 +- "IN_CALL_CONNECT",
1301 +- "CALL_CLEAR_REQUEST",
1302 +- "CALL_DISCONNECT_NOTIFY",
1303 +- "WAN_ERROR_NOTIFY",
1304 +- "SET_LINK_INFO"
1305 ++static const char *const pptp_msg_name_array[PPTP_MSG_MAX + 1] = {
1306 ++ [0] = "UNKNOWN_MESSAGE",
1307 ++ [PPTP_START_SESSION_REQUEST] = "START_SESSION_REQUEST",
1308 ++ [PPTP_START_SESSION_REPLY] = "START_SESSION_REPLY",
1309 ++ [PPTP_STOP_SESSION_REQUEST] = "STOP_SESSION_REQUEST",
1310 ++ [PPTP_STOP_SESSION_REPLY] = "STOP_SESSION_REPLY",
1311 ++ [PPTP_ECHO_REQUEST] = "ECHO_REQUEST",
1312 ++ [PPTP_ECHO_REPLY] = "ECHO_REPLY",
1313 ++ [PPTP_OUT_CALL_REQUEST] = "OUT_CALL_REQUEST",
1314 ++ [PPTP_OUT_CALL_REPLY] = "OUT_CALL_REPLY",
1315 ++ [PPTP_IN_CALL_REQUEST] = "IN_CALL_REQUEST",
1316 ++ [PPTP_IN_CALL_REPLY] = "IN_CALL_REPLY",
1317 ++ [PPTP_IN_CALL_CONNECT] = "IN_CALL_CONNECT",
1318 ++ [PPTP_CALL_CLEAR_REQUEST] = "CALL_CLEAR_REQUEST",
1319 ++ [PPTP_CALL_DISCONNECT_NOTIFY] = "CALL_DISCONNECT_NOTIFY",
1320 ++ [PPTP_WAN_ERROR_NOTIFY] = "WAN_ERROR_NOTIFY",
1321 ++ [PPTP_SET_LINK_INFO] = "SET_LINK_INFO"
1322 + };
1323 ++
1324 ++const char *pptp_msg_name(u_int16_t msg)
1325 ++{
1326 ++ if (msg > PPTP_MSG_MAX)
1327 ++ return pptp_msg_name_array[0];
1328 ++
1329 ++ return pptp_msg_name_array[msg];
1330 ++}
1331 + EXPORT_SYMBOL(pptp_msg_name);
1332 + #endif
1333 +
1334 +@@ -277,7 +285,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
1335 + typeof(nf_nat_pptp_hook_inbound) nf_nat_pptp_inbound;
1336 +
1337 + msg = ntohs(ctlh->messageType);
1338 +- pr_debug("inbound control message %s\n", pptp_msg_name[msg]);
1339 ++ pr_debug("inbound control message %s\n", pptp_msg_name(msg));
1340 +
1341 + switch (msg) {
1342 + case PPTP_START_SESSION_REPLY:
1343 +@@ -312,7 +320,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
1344 + pcid = pptpReq->ocack.peersCallID;
1345 + if (info->pns_call_id != pcid)
1346 + goto invalid;
1347 +- pr_debug("%s, CID=%X, PCID=%X\n", pptp_msg_name[msg],
1348 ++ pr_debug("%s, CID=%X, PCID=%X\n", pptp_msg_name(msg),
1349 + ntohs(cid), ntohs(pcid));
1350 +
1351 + if (pptpReq->ocack.resultCode == PPTP_OUTCALL_CONNECT) {
1352 +@@ -329,7 +337,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
1353 + goto invalid;
1354 +
1355 + cid = pptpReq->icreq.callID;
1356 +- pr_debug("%s, CID=%X\n", pptp_msg_name[msg], ntohs(cid));
1357 ++ pr_debug("%s, CID=%X\n", pptp_msg_name(msg), ntohs(cid));
1358 + info->cstate = PPTP_CALL_IN_REQ;
1359 + info->pac_call_id = cid;
1360 + break;
1361 +@@ -348,7 +356,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
1362 + if (info->pns_call_id != pcid)
1363 + goto invalid;
1364 +
1365 +- pr_debug("%s, PCID=%X\n", pptp_msg_name[msg], ntohs(pcid));
1366 ++ pr_debug("%s, PCID=%X\n", pptp_msg_name(msg), ntohs(pcid));
1367 + info->cstate = PPTP_CALL_IN_CONF;
1368 +
1369 + /* we expect a GRE connection from PAC to PNS */
1370 +@@ -358,7 +366,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
1371 + case PPTP_CALL_DISCONNECT_NOTIFY:
1372 + /* server confirms disconnect */
1373 + cid = pptpReq->disc.callID;
1374 +- pr_debug("%s, CID=%X\n", pptp_msg_name[msg], ntohs(cid));
1375 ++ pr_debug("%s, CID=%X\n", pptp_msg_name(msg), ntohs(cid));
1376 + info->cstate = PPTP_CALL_NONE;
1377 +
1378 + /* untrack this call id, unexpect GRE packets */
1379 +@@ -385,7 +393,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
1380 + invalid:
1381 + pr_debug("invalid %s: type=%d cid=%u pcid=%u "
1382 + "cstate=%d sstate=%d pns_cid=%u pac_cid=%u\n",
1383 +- msg <= PPTP_MSG_MAX ? pptp_msg_name[msg] : pptp_msg_name[0],
1384 ++ pptp_msg_name(msg),
1385 + msg, ntohs(cid), ntohs(pcid), info->cstate, info->sstate,
1386 + ntohs(info->pns_call_id), ntohs(info->pac_call_id));
1387 + return NF_ACCEPT;
1388 +@@ -405,7 +413,7 @@ pptp_outbound_pkt(struct sk_buff *skb, unsigned int protoff,
1389 + typeof(nf_nat_pptp_hook_outbound) nf_nat_pptp_outbound;
1390 +
1391 + msg = ntohs(ctlh->messageType);
1392 +- pr_debug("outbound control message %s\n", pptp_msg_name[msg]);
1393 ++ pr_debug("outbound control message %s\n", pptp_msg_name(msg));
1394 +
1395 + switch (msg) {
1396 + case PPTP_START_SESSION_REQUEST:
1397 +@@ -427,7 +435,7 @@ pptp_outbound_pkt(struct sk_buff *skb, unsigned int protoff,
1398 + info->cstate = PPTP_CALL_OUT_REQ;
1399 + /* track PNS call id */
1400 + cid = pptpReq->ocreq.callID;
1401 +- pr_debug("%s, CID=%X\n", pptp_msg_name[msg], ntohs(cid));
1402 ++ pr_debug("%s, CID=%X\n", pptp_msg_name(msg), ntohs(cid));
1403 + info->pns_call_id = cid;
1404 + break;
1405 +
1406 +@@ -441,7 +449,7 @@ pptp_outbound_pkt(struct sk_buff *skb, unsigned int protoff,
1407 + pcid = pptpReq->icack.peersCallID;
1408 + if (info->pac_call_id != pcid)
1409 + goto invalid;
1410 +- pr_debug("%s, CID=%X PCID=%X\n", pptp_msg_name[msg],
1411 ++ pr_debug("%s, CID=%X PCID=%X\n", pptp_msg_name(msg),
1412 + ntohs(cid), ntohs(pcid));
1413 +
1414 + if (pptpReq->icack.resultCode == PPTP_INCALL_ACCEPT) {
1415 +@@ -481,7 +489,7 @@ pptp_outbound_pkt(struct sk_buff *skb, unsigned int protoff,
1416 + invalid:
1417 + pr_debug("invalid %s: type=%d cid=%u pcid=%u "
1418 + "cstate=%d sstate=%d pns_cid=%u pac_cid=%u\n",
1419 +- msg <= PPTP_MSG_MAX ? pptp_msg_name[msg] : pptp_msg_name[0],
1420 ++ pptp_msg_name(msg),
1421 + msg, ntohs(cid), ntohs(pcid), info->cstate, info->sstate,
1422 + ntohs(info->pns_call_id), ntohs(info->pac_call_id));
1423 + return NF_ACCEPT;
1424 +diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
1425 +index 41547c6e496a..a8253079902f 100644
1426 +--- a/net/qrtr/qrtr.c
1427 ++++ b/net/qrtr/qrtr.c
1428 +@@ -571,7 +571,7 @@ static int qrtr_bcast_enqueue(struct qrtr_node *node, struct sk_buff *skb)
1429 + }
1430 + mutex_unlock(&qrtr_node_lock);
1431 +
1432 +- qrtr_local_enqueue(node, skb);
1433 ++ qrtr_local_enqueue(NULL, skb);
1434 +
1435 + return 0;
1436 + }
1437 +diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
1438 +index 1a3c75347f48..146b568962e0 100644
1439 +--- a/net/sctp/sm_statefuns.c
1440 ++++ b/net/sctp/sm_statefuns.c
1441 +@@ -1793,12 +1793,13 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(struct net *net,
1442 + /* Update the content of current association. */
1443 + sctp_add_cmd_sf(commands, SCTP_CMD_UPDATE_ASSOC, SCTP_ASOC(new_asoc));
1444 + sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev));
1445 +- if (sctp_state(asoc, SHUTDOWN_PENDING) &&
1446 ++ if ((sctp_state(asoc, SHUTDOWN_PENDING) ||
1447 ++ sctp_state(asoc, SHUTDOWN_SENT)) &&
1448 + (sctp_sstate(asoc->base.sk, CLOSING) ||
1449 + sock_flag(asoc->base.sk, SOCK_DEAD))) {
1450 +- /* if were currently in SHUTDOWN_PENDING, but the socket
1451 +- * has been closed by user, don't transition to ESTABLISHED.
1452 +- * Instead trigger SHUTDOWN bundled with COOKIE_ACK.
1453 ++ /* If the socket has been closed by user, don't
1454 ++ * transition to ESTABLISHED. Instead trigger SHUTDOWN
1455 ++ * bundled with COOKIE_ACK.
1456 + */
1457 + sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl));
1458 + return sctp_sf_do_9_2_start_shutdown(net, ep, asoc,
1459 +diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
1460 +index 6e3f0254d8a1..1e87639f2c27 100644
1461 +--- a/net/xfrm/xfrm_input.c
1462 ++++ b/net/xfrm/xfrm_input.c
1463 +@@ -302,7 +302,7 @@ resume:
1464 + dev_put(skb->dev);
1465 +
1466 + spin_lock(&x->lock);
1467 +- if (nexthdr <= 0) {
1468 ++ if (nexthdr < 0) {
1469 + if (nexthdr == -EBADMSG) {
1470 + xfrm_audit_state_icvfail(x, skb,
1471 + x->type->proto);
1472 +diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
1473 +index 637387bbaaea..2c4aa7b5ccd5 100644
1474 +--- a/net/xfrm/xfrm_output.c
1475 ++++ b/net/xfrm/xfrm_output.c
1476 +@@ -240,7 +240,8 @@ void xfrm_local_error(struct sk_buff *skb, int mtu)
1477 +
1478 + if (skb->protocol == htons(ETH_P_IP))
1479 + proto = AF_INET;
1480 +- else if (skb->protocol == htons(ETH_P_IPV6))
1481 ++ else if (skb->protocol == htons(ETH_P_IPV6) &&
1482 ++ skb->sk->sk_family == AF_INET6)
1483 + proto = AF_INET6;
1484 + else
1485 + return;
1486 +diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
1487 +index 69d061d4ed4f..b00ed36b9aac 100644
1488 +--- a/net/xfrm/xfrm_policy.c
1489 ++++ b/net/xfrm/xfrm_policy.c
1490 +@@ -757,12 +757,7 @@ static void xfrm_policy_requeue(struct xfrm_policy *old,
1491 + static bool xfrm_policy_mark_match(struct xfrm_policy *policy,
1492 + struct xfrm_policy *pol)
1493 + {
1494 +- u32 mark = policy->mark.v & policy->mark.m;
1495 +-
1496 +- if (policy->mark.v == pol->mark.v && policy->mark.m == pol->mark.m)
1497 +- return true;
1498 +-
1499 +- if ((mark & pol->mark.m) == pol->mark.v &&
1500 ++ if (policy->mark.v == pol->mark.v &&
1501 + policy->priority == pol->priority)
1502 + return true;
1503 +
1504 +diff --git a/security/commoncap.c b/security/commoncap.c
1505 +index 8df676fbd393..b86aca8d6798 100644
1506 +--- a/security/commoncap.c
1507 ++++ b/security/commoncap.c
1508 +@@ -497,6 +497,7 @@ int cap_bprm_set_creds(struct linux_binprm *bprm)
1509 + int ret;
1510 + kuid_t root_uid;
1511 +
1512 ++ new->cap_ambient = old->cap_ambient;
1513 + if (WARN_ON(!cap_ambient_invariant_ok(old)))
1514 + return -EPERM;
1515 +
1516 +diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
1517 +index 36d2416f90d9..96b737adf4d2 100644
1518 +--- a/sound/core/hwdep.c
1519 ++++ b/sound/core/hwdep.c
1520 +@@ -228,14 +228,14 @@ static int snd_hwdep_dsp_load(struct snd_hwdep *hw,
1521 + if (copy_from_user(&info, _info, sizeof(info)))
1522 + return -EFAULT;
1523 + /* check whether the dsp was already loaded */
1524 +- if (hw->dsp_loaded & (1 << info.index))
1525 ++ if (hw->dsp_loaded & (1u << info.index))
1526 + return -EBUSY;
1527 + if (!access_ok(VERIFY_READ, info.image, info.length))
1528 + return -EFAULT;
1529 + err = hw->ops.dsp_load(hw, &info);
1530 + if (err < 0)
1531 + return err;
1532 +- hw->dsp_loaded |= (1 << info.index);
1533 ++ hw->dsp_loaded |= (1u << info.index);
1534 + return 0;
1535 + }
1536 +
1537 +diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
1538 +index e2f62362a0b0..024864ce3f76 100644
1539 +--- a/sound/usb/mixer.c
1540 ++++ b/sound/usb/mixer.c
1541 +@@ -980,6 +980,14 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval,
1542 + cval->res = 384;
1543 + }
1544 + break;
1545 ++ case USB_ID(0x0495, 0x3042): /* ESS Technology Asus USB DAC */
1546 ++ if ((strstr(kctl->id.name, "Playback Volume") != NULL) ||
1547 ++ strstr(kctl->id.name, "Capture Volume") != NULL) {
1548 ++ cval->min >>= 8;
1549 ++ cval->max = 0;
1550 ++ cval->res = 1;
1551 ++ }
1552 ++ break;
1553 + }
1554 + }
1555 +