Gentoo Archives: gentoo-commits

From: Alice Ferrazzi <alicef@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.9 commit in: /
Date: Wed, 28 Apr 2021 11:03:37
Message-Id: 1619607790.6d0c5e17af9301c7681c955529d48d5c93ed2bd6.alicef@gentoo
1 commit: 6d0c5e17af9301c7681c955529d48d5c93ed2bd6
2 Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 28 11:02:54 2021 +0000
4 Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 28 11:03:10 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=6d0c5e17
7
8 Linux patch 4.9.268
9
10 Signed-off-by: Alice Ferrazzi <alicef <AT> gentoo.org>
11
12 0000_README | 4 +
13 1267_linux-4.9.268.patch | 1031 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 1035 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 8021097..7dcbe7c 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -1111,6 +1111,10 @@ Patch: 1266_linux-4.9.267.patch
21 From: http://www.kernel.org
22 Desc: Linux 4.9.267
23
24 +Patch: 1267_linux-4.9.268.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 4.9.268
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/1267_linux-4.9.268.patch b/1267_linux-4.9.268.patch
33 new file mode 100644
34 index 0000000..22067c4
35 --- /dev/null
36 +++ b/1267_linux-4.9.268.patch
37 @@ -0,0 +1,1031 @@
38 +diff --git a/Makefile b/Makefile
39 +index 790f3619772a8..642365d416be1 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,6 +1,6 @@
43 + VERSION = 4
44 + PATCHLEVEL = 9
45 +-SUBLEVEL = 267
46 ++SUBLEVEL = 268
47 + EXTRAVERSION =
48 + NAME = Roaring Lionus
49 +
50 +diff --git a/arch/arc/kernel/signal.c b/arch/arc/kernel/signal.c
51 +index d347bbc086fed..16cdb471d3db6 100644
52 +--- a/arch/arc/kernel/signal.c
53 ++++ b/arch/arc/kernel/signal.c
54 +@@ -97,7 +97,7 @@ stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs,
55 + sizeof(sf->uc.uc_mcontext.regs.scratch));
56 + err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(sigset_t));
57 +
58 +- return err;
59 ++ return err ? -EFAULT : 0;
60 + }
61 +
62 + static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf)
63 +@@ -111,7 +111,7 @@ static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf)
64 + &(sf->uc.uc_mcontext.regs.scratch),
65 + sizeof(sf->uc.uc_mcontext.regs.scratch));
66 + if (err)
67 +- return err;
68 ++ return -EFAULT;
69 +
70 + set_current_blocked(&set);
71 + regs->bta = uregs.scratch.bta;
72 +diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
73 +index 2008648b8c9f9..0a7600d06fb56 100644
74 +--- a/arch/arm/boot/dts/omap3.dtsi
75 ++++ b/arch/arm/boot/dts/omap3.dtsi
76 +@@ -23,6 +23,9 @@
77 + i2c0 = &i2c1;
78 + i2c1 = &i2c2;
79 + i2c2 = &i2c3;
80 ++ mmc0 = &mmc1;
81 ++ mmc1 = &mmc2;
82 ++ mmc2 = &mmc3;
83 + serial0 = &uart1;
84 + serial1 = &uart2;
85 + serial2 = &uart3;
86 +diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
87 +index 4d6584f15b174..7e5a09c3d2a6b 100644
88 +--- a/arch/arm/boot/dts/omap4.dtsi
89 ++++ b/arch/arm/boot/dts/omap4.dtsi
90 +@@ -22,6 +22,11 @@
91 + i2c1 = &i2c2;
92 + i2c2 = &i2c3;
93 + i2c3 = &i2c4;
94 ++ mmc0 = &mmc1;
95 ++ mmc1 = &mmc2;
96 ++ mmc2 = &mmc3;
97 ++ mmc3 = &mmc4;
98 ++ mmc4 = &mmc5;
99 + serial0 = &uart1;
100 + serial1 = &uart2;
101 + serial2 = &uart3;
102 +diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
103 +index a76266f242a1f..586fe60b9921f 100644
104 +--- a/arch/arm/boot/dts/omap5.dtsi
105 ++++ b/arch/arm/boot/dts/omap5.dtsi
106 +@@ -25,6 +25,11 @@
107 + i2c2 = &i2c3;
108 + i2c3 = &i2c4;
109 + i2c4 = &i2c5;
110 ++ mmc0 = &mmc1;
111 ++ mmc1 = &mmc2;
112 ++ mmc2 = &mmc3;
113 ++ mmc3 = &mmc4;
114 ++ mmc4 = &mmc5;
115 + serial0 = &uart1;
116 + serial1 = &uart2;
117 + serial2 = &uart3;
118 +diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c
119 +index 84613abf35a33..79ff5b9534313 100644
120 +--- a/arch/arm/mach-keystone/keystone.c
121 ++++ b/arch/arm/mach-keystone/keystone.c
122 +@@ -65,7 +65,7 @@ static void __init keystone_init(void)
123 + static long long __init keystone_pv_fixup(void)
124 + {
125 + long long offset;
126 +- phys_addr_t mem_start, mem_end;
127 ++ u64 mem_start, mem_end;
128 +
129 + mem_start = memblock_start_of_DRAM();
130 + mem_end = memblock_end_of_DRAM();
131 +@@ -78,7 +78,7 @@ static long long __init keystone_pv_fixup(void)
132 + if (mem_start < KEYSTONE_HIGH_PHYS_START ||
133 + mem_end > KEYSTONE_HIGH_PHYS_END) {
134 + pr_crit("Invalid address space for memory (%08llx-%08llx)\n",
135 +- (u64)mem_start, (u64)mem_end);
136 ++ mem_start, mem_end);
137 + return 0;
138 + }
139 +
140 +diff --git a/arch/arm/probes/uprobes/core.c b/arch/arm/probes/uprobes/core.c
141 +index d1329f1ba4e4c..b97230704b744 100644
142 +--- a/arch/arm/probes/uprobes/core.c
143 ++++ b/arch/arm/probes/uprobes/core.c
144 +@@ -207,7 +207,7 @@ unsigned long uprobe_get_swbp_addr(struct pt_regs *regs)
145 + static struct undef_hook uprobes_arm_break_hook = {
146 + .instr_mask = 0x0fffffff,
147 + .instr_val = (UPROBE_SWBP_ARM_INSN & 0x0fffffff),
148 +- .cpsr_mask = MODE_MASK,
149 ++ .cpsr_mask = (PSR_T_BIT | MODE_MASK),
150 + .cpsr_val = USR_MODE,
151 + .fn = uprobe_trap_handler,
152 + };
153 +@@ -215,7 +215,7 @@ static struct undef_hook uprobes_arm_break_hook = {
154 + static struct undef_hook uprobes_arm_ss_hook = {
155 + .instr_mask = 0x0fffffff,
156 + .instr_val = (UPROBE_SS_ARM_INSN & 0x0fffffff),
157 +- .cpsr_mask = MODE_MASK,
158 ++ .cpsr_mask = (PSR_T_BIT | MODE_MASK),
159 + .cpsr_val = USR_MODE,
160 + .fn = uprobe_trap_handler,
161 + };
162 +diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
163 +index 8786268053693..3b0c892953ab4 100644
164 +--- a/arch/ia64/mm/discontig.c
165 ++++ b/arch/ia64/mm/discontig.c
166 +@@ -99,7 +99,7 @@ static int __init build_node_maps(unsigned long start, unsigned long len,
167 + * acpi_boot_init() (which builds the node_to_cpu_mask array) hasn't been
168 + * called yet. Note that node 0 will also count all non-existent cpus.
169 + */
170 +-static int __meminit early_nr_cpus_node(int node)
171 ++static int early_nr_cpus_node(int node)
172 + {
173 + int cpu, n = 0;
174 +
175 +@@ -114,7 +114,7 @@ static int __meminit early_nr_cpus_node(int node)
176 + * compute_pernodesize - compute size of pernode data
177 + * @node: the node id.
178 + */
179 +-static unsigned long __meminit compute_pernodesize(int node)
180 ++static unsigned long compute_pernodesize(int node)
181 + {
182 + unsigned long pernodesize = 0, cpus;
183 +
184 +@@ -411,7 +411,7 @@ static void __init reserve_pernode_space(void)
185 + }
186 + }
187 +
188 +-static void __meminit scatter_node_data(void)
189 ++static void scatter_node_data(void)
190 + {
191 + pg_data_t **dst;
192 + int node;
193 +diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
194 +index 771cfd2e1e6d8..708b8ee604d0a 100644
195 +--- a/arch/s390/kernel/entry.S
196 ++++ b/arch/s390/kernel/entry.S
197 +@@ -902,6 +902,7 @@ ENTRY(ext_int_handler)
198 + * Load idle PSW. The second "half" of this function is in .Lcleanup_idle.
199 + */
200 + ENTRY(psw_idle)
201 ++ stg %r14,(__SF_GPRS+8*8)(%r15)
202 + stg %r3,__SF_EMPTY(%r15)
203 + larl %r1,.Lpsw_idle_lpsw+4
204 + stg %r1,__SF_EMPTY+8(%r15)
205 +diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
206 +index 650830e39e3a7..b3ac57f0e068e 100644
207 +--- a/arch/x86/kernel/crash.c
208 ++++ b/arch/x86/kernel/crash.c
209 +@@ -23,6 +23,7 @@
210 + #include <linux/export.h>
211 + #include <linux/slab.h>
212 + #include <linux/vmalloc.h>
213 ++#include <linux/overflow.h>
214 +
215 + #include <asm/processor.h>
216 + #include <asm/hardirq.h>
217 +@@ -564,7 +565,7 @@ int crash_setup_memmap_entries(struct kimage *image, struct boot_params *params)
218 + struct crash_memmap_data cmd;
219 + struct crash_mem *cmem;
220 +
221 +- cmem = vzalloc(sizeof(struct crash_mem));
222 ++ cmem = vzalloc(struct_size(cmem, ranges, 1));
223 + if (!cmem)
224 + return -ENOMEM;
225 +
226 +diff --git a/drivers/dma/dw/Kconfig b/drivers/dma/dw/Kconfig
227 +index e00c9b0229647..6ea3e95c287bd 100644
228 +--- a/drivers/dma/dw/Kconfig
229 ++++ b/drivers/dma/dw/Kconfig
230 +@@ -11,6 +11,7 @@ config DW_DMAC_BIG_ENDIAN_IO
231 +
232 + config DW_DMAC
233 + tristate "Synopsys DesignWare AHB DMA platform driver"
234 ++ depends on HAS_IOMEM
235 + select DW_DMAC_CORE
236 + select DW_DMAC_BIG_ENDIAN_IO if AVR32
237 + default y if CPU_AT32AP7000
238 +@@ -21,6 +22,7 @@ config DW_DMAC
239 + config DW_DMAC_PCI
240 + tristate "Synopsys DesignWare AHB DMA PCI driver"
241 + depends on PCI
242 ++ depends on HAS_IOMEM
243 + select DW_DMAC_CORE
244 + help
245 + Support the Synopsys DesignWare AHB DMA controller on the
246 +diff --git a/drivers/hid/hid-alps.c b/drivers/hid/hid-alps.c
247 +index ed9c0ea5b026e..1bc6ad0339d22 100644
248 +--- a/drivers/hid/hid-alps.c
249 ++++ b/drivers/hid/hid-alps.c
250 +@@ -429,6 +429,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi)
251 + ret = input_register_device(data->input2);
252 + if (ret) {
253 + input_free_device(input2);
254 ++ ret = -ENOENT;
255 + goto exit;
256 + }
257 + }
258 +diff --git a/drivers/input/keyboard/nspire-keypad.c b/drivers/input/keyboard/nspire-keypad.c
259 +index 7abfd34eb87ec..bcec72367c1d4 100644
260 +--- a/drivers/input/keyboard/nspire-keypad.c
261 ++++ b/drivers/input/keyboard/nspire-keypad.c
262 +@@ -96,9 +96,15 @@ static irqreturn_t nspire_keypad_irq(int irq, void *dev_id)
263 + return IRQ_HANDLED;
264 + }
265 +
266 +-static int nspire_keypad_chip_init(struct nspire_keypad *keypad)
267 ++static int nspire_keypad_open(struct input_dev *input)
268 + {
269 ++ struct nspire_keypad *keypad = input_get_drvdata(input);
270 + unsigned long val = 0, cycles_per_us, delay_cycles, row_delay_cycles;
271 ++ int error;
272 ++
273 ++ error = clk_prepare_enable(keypad->clk);
274 ++ if (error)
275 ++ return error;
276 +
277 + cycles_per_us = (clk_get_rate(keypad->clk) / 1000000);
278 + if (cycles_per_us == 0)
279 +@@ -124,30 +130,6 @@ static int nspire_keypad_chip_init(struct nspire_keypad *keypad)
280 + keypad->int_mask = 1 << 1;
281 + writel(keypad->int_mask, keypad->reg_base + KEYPAD_INTMSK);
282 +
283 +- /* Disable GPIO interrupts to prevent hanging on touchpad */
284 +- /* Possibly used to detect touchpad events */
285 +- writel(0, keypad->reg_base + KEYPAD_UNKNOWN_INT);
286 +- /* Acknowledge existing interrupts */
287 +- writel(~0, keypad->reg_base + KEYPAD_UNKNOWN_INT_STS);
288 +-
289 +- return 0;
290 +-}
291 +-
292 +-static int nspire_keypad_open(struct input_dev *input)
293 +-{
294 +- struct nspire_keypad *keypad = input_get_drvdata(input);
295 +- int error;
296 +-
297 +- error = clk_prepare_enable(keypad->clk);
298 +- if (error)
299 +- return error;
300 +-
301 +- error = nspire_keypad_chip_init(keypad);
302 +- if (error) {
303 +- clk_disable_unprepare(keypad->clk);
304 +- return error;
305 +- }
306 +-
307 + return 0;
308 + }
309 +
310 +@@ -155,6 +137,11 @@ static void nspire_keypad_close(struct input_dev *input)
311 + {
312 + struct nspire_keypad *keypad = input_get_drvdata(input);
313 +
314 ++ /* Disable interrupts */
315 ++ writel(0, keypad->reg_base + KEYPAD_INTMSK);
316 ++ /* Acknowledge existing interrupts */
317 ++ writel(~0, keypad->reg_base + KEYPAD_INT);
318 ++
319 + clk_disable_unprepare(keypad->clk);
320 + }
321 +
322 +@@ -215,6 +202,25 @@ static int nspire_keypad_probe(struct platform_device *pdev)
323 + return -ENOMEM;
324 + }
325 +
326 ++ error = clk_prepare_enable(keypad->clk);
327 ++ if (error) {
328 ++ dev_err(&pdev->dev, "failed to enable clock\n");
329 ++ return error;
330 ++ }
331 ++
332 ++ /* Disable interrupts */
333 ++ writel(0, keypad->reg_base + KEYPAD_INTMSK);
334 ++ /* Acknowledge existing interrupts */
335 ++ writel(~0, keypad->reg_base + KEYPAD_INT);
336 ++
337 ++ /* Disable GPIO interrupts to prevent hanging on touchpad */
338 ++ /* Possibly used to detect touchpad events */
339 ++ writel(0, keypad->reg_base + KEYPAD_UNKNOWN_INT);
340 ++ /* Acknowledge existing GPIO interrupts */
341 ++ writel(~0, keypad->reg_base + KEYPAD_UNKNOWN_INT_STS);
342 ++
343 ++ clk_disable_unprepare(keypad->clk);
344 ++
345 + input_set_drvdata(input, keypad);
346 +
347 + input->id.bustype = BUS_HOST;
348 +diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
349 +index ff0f3c3e2f804..3049bccf24227 100644
350 +--- a/drivers/input/serio/i8042-x86ia64io.h
351 ++++ b/drivers/input/serio/i8042-x86ia64io.h
352 +@@ -579,6 +579,7 @@ static const struct dmi_system_id i8042_dmi_forcemux_table[] __initconst = {
353 + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
354 + DMI_MATCH(DMI_PRODUCT_NAME, "VGN-CS"),
355 + },
356 ++ }, {
357 + .matches = {
358 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
359 + DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */
360 +diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
361 +index c22bf52d3320b..c3887ac3d04d5 100644
362 +--- a/drivers/net/ethernet/amd/pcnet32.c
363 ++++ b/drivers/net/ethernet/amd/pcnet32.c
364 +@@ -1493,8 +1493,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
365 + }
366 + pci_set_master(pdev);
367 +
368 +- ioaddr = pci_resource_start(pdev, 0);
369 +- if (!ioaddr) {
370 ++ if (!pci_resource_len(pdev, 0)) {
371 + if (pcnet32_debug & NETIF_MSG_PROBE)
372 + pr_err("card has no PCI IO resources, aborting\n");
373 + return -ENODEV;
374 +@@ -1506,6 +1505,8 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
375 + pr_err("architecture does not support 32bit PCI busmaster DMA\n");
376 + return err;
377 + }
378 ++
379 ++ ioaddr = pci_resource_start(pdev, 0);
380 + if (!request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci")) {
381 + if (pcnet32_debug & NETIF_MSG_PROBE)
382 + pr_err("io address range already allocated\n");
383 +diff --git a/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h b/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h
384 +index 5e3aff242ad38..3ab84d18ad3ac 100644
385 +--- a/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h
386 ++++ b/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h
387 +@@ -417,7 +417,7 @@
388 + | CN6XXX_INTR_M0UNWI_ERR \
389 + | CN6XXX_INTR_M1UPB0_ERR \
390 + | CN6XXX_INTR_M1UPWI_ERR \
391 +- | CN6XXX_INTR_M1UPB0_ERR \
392 ++ | CN6XXX_INTR_M1UNB0_ERR \
393 + | CN6XXX_INTR_M1UNWI_ERR \
394 + | CN6XXX_INTR_INSTR_DB_OF_ERR \
395 + | CN6XXX_INTR_SLIST_DB_OF_ERR \
396 +diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
397 +index f1e4cde963d8f..0fe4d89998230 100644
398 +--- a/drivers/net/ethernet/davicom/dm9000.c
399 ++++ b/drivers/net/ethernet/davicom/dm9000.c
400 +@@ -1481,8 +1481,10 @@ dm9000_probe(struct platform_device *pdev)
401 +
402 + /* Init network device */
403 + ndev = alloc_etherdev(sizeof(struct board_info));
404 +- if (!ndev)
405 +- return -ENOMEM;
406 ++ if (!ndev) {
407 ++ ret = -ENOMEM;
408 ++ goto out_regulator_disable;
409 ++ }
410 +
411 + SET_NETDEV_DEV(ndev, &pdev->dev);
412 +
413 +diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
414 +index 043b69b5843b0..40644657b1b74 100644
415 +--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
416 ++++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
417 +@@ -8504,6 +8504,7 @@ static int i40e_sw_init(struct i40e_pf *pf)
418 + {
419 + int err = 0;
420 + int size;
421 ++ u16 pow;
422 +
423 + pf->msg_enable = netif_msg_init(I40E_DEFAULT_MSG_ENABLE,
424 + (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK));
425 +@@ -8531,6 +8532,11 @@ static int i40e_sw_init(struct i40e_pf *pf)
426 + pf->rss_table_size = pf->hw.func_caps.rss_table_size;
427 + pf->rss_size_max = min_t(int, pf->rss_size_max,
428 + pf->hw.func_caps.num_tx_qp);
429 ++
430 ++ /* find the next higher power-of-2 of num cpus */
431 ++ pow = roundup_pow_of_two(num_online_cpus());
432 ++ pf->rss_size_max = min_t(int, pf->rss_size_max, pow);
433 ++
434 + if (pf->hw.func_caps.rss) {
435 + pf->flags |= I40E_FLAG_RSS_ENABLED;
436 + pf->alloc_rss_size = min_t(int, pf->rss_size_max,
437 +diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
438 +index c4b4c2c347647..6ecccc737974c 100644
439 +--- a/drivers/net/usb/hso.c
440 ++++ b/drivers/net/usb/hso.c
441 +@@ -626,7 +626,7 @@ static struct hso_serial *get_serial_by_index(unsigned index)
442 + return serial;
443 + }
444 +
445 +-static int get_free_serial_index(void)
446 ++static int obtain_minor(struct hso_serial *serial)
447 + {
448 + int index;
449 + unsigned long flags;
450 +@@ -634,8 +634,10 @@ static int get_free_serial_index(void)
451 + spin_lock_irqsave(&serial_table_lock, flags);
452 + for (index = 0; index < HSO_SERIAL_TTY_MINORS; index++) {
453 + if (serial_table[index] == NULL) {
454 ++ serial_table[index] = serial->parent;
455 ++ serial->minor = index;
456 + spin_unlock_irqrestore(&serial_table_lock, flags);
457 +- return index;
458 ++ return 0;
459 + }
460 + }
461 + spin_unlock_irqrestore(&serial_table_lock, flags);
462 +@@ -644,15 +646,12 @@ static int get_free_serial_index(void)
463 + return -1;
464 + }
465 +
466 +-static void set_serial_by_index(unsigned index, struct hso_serial *serial)
467 ++static void release_minor(struct hso_serial *serial)
468 + {
469 + unsigned long flags;
470 +
471 + spin_lock_irqsave(&serial_table_lock, flags);
472 +- if (serial)
473 +- serial_table[index] = serial->parent;
474 +- else
475 +- serial_table[index] = NULL;
476 ++ serial_table[serial->minor] = NULL;
477 + spin_unlock_irqrestore(&serial_table_lock, flags);
478 + }
479 +
480 +@@ -2243,6 +2242,7 @@ static int hso_stop_serial_device(struct hso_device *hso_dev)
481 + static void hso_serial_tty_unregister(struct hso_serial *serial)
482 + {
483 + tty_unregister_device(tty_drv, serial->minor);
484 ++ release_minor(serial);
485 + }
486 +
487 + static void hso_serial_common_free(struct hso_serial *serial)
488 +@@ -2267,25 +2267,23 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs,
489 + int rx_size, int tx_size)
490 + {
491 + struct device *dev;
492 +- int minor;
493 + int i;
494 +
495 + tty_port_init(&serial->port);
496 +
497 +- minor = get_free_serial_index();
498 +- if (minor < 0)
499 ++ if (obtain_minor(serial))
500 + goto exit2;
501 +
502 + /* register our minor number */
503 + serial->parent->dev = tty_port_register_device_attr(&serial->port,
504 +- tty_drv, minor, &serial->parent->interface->dev,
505 ++ tty_drv, serial->minor, &serial->parent->interface->dev,
506 + serial->parent, hso_serial_dev_groups);
507 +- if (IS_ERR(serial->parent->dev))
508 ++ if (IS_ERR(serial->parent->dev)) {
509 ++ release_minor(serial);
510 + goto exit2;
511 ++ }
512 + dev = serial->parent->dev;
513 +
514 +- /* fill in specific data for later use */
515 +- serial->minor = minor;
516 + serial->magic = HSO_SERIAL_MAGIC;
517 + spin_lock_init(&serial->serial_lock);
518 + serial->num_rx_urbs = num_urbs;
519 +@@ -2678,9 +2676,6 @@ static struct hso_device *hso_create_bulk_serial_device(
520 +
521 + serial->write_data = hso_std_serial_write_data;
522 +
523 +- /* and record this serial */
524 +- set_serial_by_index(serial->minor, serial);
525 +-
526 + /* setup the proc dirs and files if needed */
527 + hso_log_port(hso_dev);
528 +
529 +@@ -2737,9 +2732,6 @@ struct hso_device *hso_create_mux_serial_device(struct usb_interface *interface,
530 + serial->shared_int->ref_count++;
531 + mutex_unlock(&serial->shared_int->shared_int_lock);
532 +
533 +- /* and record this serial */
534 +- set_serial_by_index(serial->minor, serial);
535 +-
536 + /* setup the proc dirs and files if needed */
537 + hso_log_port(hso_dev);
538 +
539 +@@ -3123,8 +3115,7 @@ static void hso_free_interface(struct usb_interface *interface)
540 + cancel_work_sync(&serial_table[i]->async_put_intf);
541 + cancel_work_sync(&serial_table[i]->async_get_intf);
542 + hso_serial_tty_unregister(serial);
543 +- kref_put(&serial_table[i]->ref, hso_serial_ref_free);
544 +- set_serial_by_index(i, NULL);
545 ++ kref_put(&serial->parent->ref, hso_serial_ref_free);
546 + }
547 + }
548 +
549 +diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
550 +index 78788402edd8b..e6646c8a7bdbb 100644
551 +--- a/drivers/net/xen-netback/xenbus.c
552 ++++ b/drivers/net/xen-netback/xenbus.c
553 +@@ -1040,11 +1040,15 @@ static void connect(struct backend_info *be)
554 + xenvif_carrier_on(be->vif);
555 +
556 + unregister_hotplug_status_watch(be);
557 +- err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch, NULL,
558 +- hotplug_status_changed,
559 +- "%s/%s", dev->nodename, "hotplug-status");
560 +- if (!err)
561 ++ if (xenbus_exists(XBT_NIL, dev->nodename, "hotplug-status")) {
562 ++ err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch,
563 ++ NULL, hotplug_status_changed,
564 ++ "%s/%s", dev->nodename,
565 ++ "hotplug-status");
566 ++ if (err)
567 ++ goto err;
568 + be->have_hotplug_status_watch = 1;
569 ++ }
570 +
571 + netif_tx_wake_all_queues(be->vif->dev);
572 +
573 +diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
574 +index b820c3a022eac..8800ff615bdd4 100644
575 +--- a/drivers/scsi/libsas/sas_ata.c
576 ++++ b/drivers/scsi/libsas/sas_ata.c
577 +@@ -219,18 +219,17 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
578 + memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len);
579 + task->total_xfer_len = qc->nbytes;
580 + task->num_scatter = qc->n_elem;
581 ++ task->data_dir = qc->dma_dir;
582 ++ } else if (qc->tf.protocol == ATA_PROT_NODATA) {
583 ++ task->data_dir = DMA_NONE;
584 + } else {
585 + for_each_sg(qc->sg, sg, qc->n_elem, si)
586 + xfer += sg_dma_len(sg);
587 +
588 + task->total_xfer_len = xfer;
589 + task->num_scatter = si;
590 +- }
591 +-
592 +- if (qc->tf.protocol == ATA_PROT_NODATA)
593 +- task->data_dir = DMA_NONE;
594 +- else
595 + task->data_dir = qc->dma_dir;
596 ++ }
597 + task->scatter = qc->sg;
598 + task->ata_task.retry_count = 1;
599 + task->task_state_flags = SAS_TASK_STATE_PENDING;
600 +diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c
601 +index 6b643e6c8f0bd..cec5805feb254 100644
602 +--- a/drivers/usb/usbip/stub_dev.c
603 ++++ b/drivers/usb/usbip/stub_dev.c
604 +@@ -77,6 +77,7 @@ static ssize_t store_sockfd(struct device *dev, struct device_attribute *attr,
605 +
606 + dev_info(dev, "stub up\n");
607 +
608 ++ mutex_lock(&sdev->ud.sysfs_lock);
609 + spin_lock_irq(&sdev->ud.lock);
610 +
611 + if (sdev->ud.status != SDEV_ST_AVAILABLE) {
612 +@@ -101,13 +102,13 @@ static ssize_t store_sockfd(struct device *dev, struct device_attribute *attr,
613 + tcp_rx = kthread_create(stub_rx_loop, &sdev->ud, "stub_rx");
614 + if (IS_ERR(tcp_rx)) {
615 + sockfd_put(socket);
616 +- return -EINVAL;
617 ++ goto unlock_mutex;
618 + }
619 + tcp_tx = kthread_create(stub_tx_loop, &sdev->ud, "stub_tx");
620 + if (IS_ERR(tcp_tx)) {
621 + kthread_stop(tcp_rx);
622 + sockfd_put(socket);
623 +- return -EINVAL;
624 ++ goto unlock_mutex;
625 + }
626 +
627 + /* get task structs now */
628 +@@ -126,6 +127,8 @@ static ssize_t store_sockfd(struct device *dev, struct device_attribute *attr,
629 + wake_up_process(sdev->ud.tcp_rx);
630 + wake_up_process(sdev->ud.tcp_tx);
631 +
632 ++ mutex_unlock(&sdev->ud.sysfs_lock);
633 ++
634 + } else {
635 + dev_info(dev, "stub down\n");
636 +
637 +@@ -136,6 +139,7 @@ static ssize_t store_sockfd(struct device *dev, struct device_attribute *attr,
638 + spin_unlock_irq(&sdev->ud.lock);
639 +
640 + usbip_event_add(&sdev->ud, SDEV_EVENT_DOWN);
641 ++ mutex_unlock(&sdev->ud.sysfs_lock);
642 + }
643 +
644 + return count;
645 +@@ -144,6 +148,8 @@ sock_err:
646 + sockfd_put(socket);
647 + err:
648 + spin_unlock_irq(&sdev->ud.lock);
649 ++unlock_mutex:
650 ++ mutex_unlock(&sdev->ud.sysfs_lock);
651 + return -EINVAL;
652 + }
653 + static DEVICE_ATTR(usbip_sockfd, S_IWUSR, NULL, store_sockfd);
654 +@@ -309,6 +315,7 @@ static struct stub_device *stub_device_alloc(struct usb_device *udev)
655 + sdev->ud.side = USBIP_STUB;
656 + sdev->ud.status = SDEV_ST_AVAILABLE;
657 + spin_lock_init(&sdev->ud.lock);
658 ++ mutex_init(&sdev->ud.sysfs_lock);
659 + sdev->ud.tcp_socket = NULL;
660 + sdev->ud.sockfd = -1;
661 +
662 +diff --git a/drivers/usb/usbip/usbip_common.h b/drivers/usb/usbip/usbip_common.h
663 +index 0b199a2664c00..3d47c681aea2f 100644
664 +--- a/drivers/usb/usbip/usbip_common.h
665 ++++ b/drivers/usb/usbip/usbip_common.h
666 +@@ -278,6 +278,9 @@ struct usbip_device {
667 + /* lock for status */
668 + spinlock_t lock;
669 +
670 ++ /* mutex for synchronizing sysfs store paths */
671 ++ struct mutex sysfs_lock;
672 ++
673 + int sockfd;
674 + struct socket *tcp_socket;
675 +
676 +diff --git a/drivers/usb/usbip/usbip_event.c b/drivers/usb/usbip/usbip_event.c
677 +index f8f7f3803a99c..01eaae1f265b2 100644
678 +--- a/drivers/usb/usbip/usbip_event.c
679 ++++ b/drivers/usb/usbip/usbip_event.c
680 +@@ -84,6 +84,7 @@ static void event_handler(struct work_struct *work)
681 + while ((ud = get_event()) != NULL) {
682 + usbip_dbg_eh("pending event %lx\n", ud->event);
683 +
684 ++ mutex_lock(&ud->sysfs_lock);
685 + /*
686 + * NOTE: shutdown must come first.
687 + * Shutdown the device.
688 +@@ -104,6 +105,7 @@ static void event_handler(struct work_struct *work)
689 + ud->eh_ops.unusable(ud);
690 + unset_event(ud, USBIP_EH_UNUSABLE);
691 + }
692 ++ mutex_unlock(&ud->sysfs_lock);
693 +
694 + wake_up(&ud->eh_waitq);
695 + }
696 +diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
697 +index 8bda6455dfcb2..fb7b03029b8e6 100644
698 +--- a/drivers/usb/usbip/vhci_hcd.c
699 ++++ b/drivers/usb/usbip/vhci_hcd.c
700 +@@ -907,6 +907,7 @@ static void vhci_device_init(struct vhci_device *vdev)
701 + vdev->ud.side = USBIP_VHCI;
702 + vdev->ud.status = VDEV_ST_NULL;
703 + spin_lock_init(&vdev->ud.lock);
704 ++ mutex_init(&vdev->ud.sysfs_lock);
705 +
706 + INIT_LIST_HEAD(&vdev->priv_rx);
707 + INIT_LIST_HEAD(&vdev->priv_tx);
708 +diff --git a/drivers/usb/usbip/vhci_sysfs.c b/drivers/usb/usbip/vhci_sysfs.c
709 +index ca00d38d22afd..3496b402aa1b7 100644
710 +--- a/drivers/usb/usbip/vhci_sysfs.c
711 ++++ b/drivers/usb/usbip/vhci_sysfs.c
712 +@@ -161,6 +161,8 @@ static int vhci_port_disconnect(struct vhci_hcd *vhci, __u32 rhport)
713 +
714 + usbip_dbg_vhci_sysfs("enter\n");
715 +
716 ++ mutex_lock(&vdev->ud.sysfs_lock);
717 ++
718 + /* lock */
719 + spin_lock_irqsave(&vhci->lock, flags);
720 + spin_lock(&vdev->ud.lock);
721 +@@ -171,6 +173,7 @@ static int vhci_port_disconnect(struct vhci_hcd *vhci, __u32 rhport)
722 + /* unlock */
723 + spin_unlock(&vdev->ud.lock);
724 + spin_unlock_irqrestore(&vhci->lock, flags);
725 ++ mutex_unlock(&vdev->ud.sysfs_lock);
726 +
727 + return -EINVAL;
728 + }
729 +@@ -181,6 +184,8 @@ static int vhci_port_disconnect(struct vhci_hcd *vhci, __u32 rhport)
730 +
731 + usbip_event_add(&vdev->ud, VDEV_EVENT_DOWN);
732 +
733 ++ mutex_unlock(&vdev->ud.sysfs_lock);
734 ++
735 + return 0;
736 + }
737 +
738 +@@ -309,30 +314,36 @@ static ssize_t store_attach(struct device *dev, struct device_attribute *attr,
739 + vhci = hcd_to_vhci(hcd);
740 + vdev = &vhci->vdev[rhport];
741 +
742 ++ mutex_lock(&vdev->ud.sysfs_lock);
743 ++
744 + /* Extract socket from fd. */
745 + socket = sockfd_lookup(sockfd, &err);
746 + if (!socket) {
747 + dev_err(dev, "failed to lookup sock");
748 +- return -EINVAL;
749 ++ err = -EINVAL;
750 ++ goto unlock_mutex;
751 + }
752 + if (socket->type != SOCK_STREAM) {
753 + dev_err(dev, "Expecting SOCK_STREAM - found %d",
754 + socket->type);
755 + sockfd_put(socket);
756 +- return -EINVAL;
757 ++ err = -EINVAL;
758 ++ goto unlock_mutex;
759 + }
760 +
761 + /* create threads before locking */
762 + tcp_rx = kthread_create(vhci_rx_loop, &vdev->ud, "vhci_rx");
763 + if (IS_ERR(tcp_rx)) {
764 + sockfd_put(socket);
765 +- return -EINVAL;
766 ++ err = -EINVAL;
767 ++ goto unlock_mutex;
768 + }
769 + tcp_tx = kthread_create(vhci_tx_loop, &vdev->ud, "vhci_tx");
770 + if (IS_ERR(tcp_tx)) {
771 + kthread_stop(tcp_rx);
772 + sockfd_put(socket);
773 +- return -EINVAL;
774 ++ err = -EINVAL;
775 ++ goto unlock_mutex;
776 + }
777 +
778 + /* get task structs now */
779 +@@ -353,7 +364,8 @@ static ssize_t store_attach(struct device *dev, struct device_attribute *attr,
780 + kthread_stop_put(tcp_tx);
781 +
782 + dev_err(dev, "port %d already used\n", rhport);
783 +- return -EINVAL;
784 ++ err = -EINVAL;
785 ++ goto unlock_mutex;
786 + }
787 +
788 + dev_info(dev, "pdev(%u) rhport(%u) sockfd(%d)\n",
789 +@@ -378,7 +390,15 @@ static ssize_t store_attach(struct device *dev, struct device_attribute *attr,
790 +
791 + rh_port_connect(vdev, speed);
792 +
793 ++ dev_info(dev, "Device attached\n");
794 ++
795 ++ mutex_unlock(&vdev->ud.sysfs_lock);
796 ++
797 + return count;
798 ++
799 ++unlock_mutex:
800 ++ mutex_unlock(&vdev->ud.sysfs_lock);
801 ++ return err;
802 + }
803 + static DEVICE_ATTR(attach, S_IWUSR, NULL, store_attach);
804 +
805 +diff --git a/drivers/usb/usbip/vudc_dev.c b/drivers/usb/usbip/vudc_dev.c
806 +index 7091848df6c8b..d61b22bb1d8bb 100644
807 +--- a/drivers/usb/usbip/vudc_dev.c
808 ++++ b/drivers/usb/usbip/vudc_dev.c
809 +@@ -582,6 +582,7 @@ static int init_vudc_hw(struct vudc *udc)
810 + init_waitqueue_head(&udc->tx_waitq);
811 +
812 + spin_lock_init(&ud->lock);
813 ++ mutex_init(&ud->sysfs_lock);
814 + ud->status = SDEV_ST_AVAILABLE;
815 + ud->side = USBIP_VUDC;
816 +
817 +diff --git a/drivers/usb/usbip/vudc_sysfs.c b/drivers/usb/usbip/vudc_sysfs.c
818 +index f44d98eeb36ac..0a4482ced945e 100644
819 +--- a/drivers/usb/usbip/vudc_sysfs.c
820 ++++ b/drivers/usb/usbip/vudc_sysfs.c
821 +@@ -125,6 +125,7 @@ static ssize_t store_sockfd(struct device *dev,
822 + dev_err(dev, "no device");
823 + return -ENODEV;
824 + }
825 ++ mutex_lock(&udc->ud.sysfs_lock);
826 + spin_lock_irqsave(&udc->lock, flags);
827 + /* Don't export what we don't have */
828 + if (!udc->driver || !udc->pullup) {
829 +@@ -187,7 +188,7 @@ static ssize_t store_sockfd(struct device *dev,
830 +
831 + udc->ud.tcp_socket = socket;
832 + udc->ud.tcp_rx = tcp_rx;
833 +- udc->ud.tcp_rx = tcp_tx;
834 ++ udc->ud.tcp_tx = tcp_tx;
835 + udc->ud.status = SDEV_ST_USED;
836 +
837 + spin_unlock_irq(&udc->ud.lock);
838 +@@ -200,6 +201,8 @@ static ssize_t store_sockfd(struct device *dev,
839 +
840 + wake_up_process(udc->ud.tcp_rx);
841 + wake_up_process(udc->ud.tcp_tx);
842 ++
843 ++ mutex_unlock(&udc->ud.sysfs_lock);
844 + return count;
845 +
846 + } else {
847 +@@ -220,6 +223,7 @@ static ssize_t store_sockfd(struct device *dev,
848 + }
849 +
850 + spin_unlock_irqrestore(&udc->lock, flags);
851 ++ mutex_unlock(&udc->ud.sysfs_lock);
852 +
853 + return count;
854 +
855 +@@ -229,6 +233,7 @@ unlock_ud:
856 + spin_unlock_irq(&udc->ud.lock);
857 + unlock:
858 + spin_unlock_irqrestore(&udc->lock, flags);
859 ++ mutex_unlock(&udc->ud.sysfs_lock);
860 +
861 + return ret;
862 + }
863 +diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
864 +index bbda3ea7039f3..4d9901a18b975 100644
865 +--- a/fs/ext4/namei.c
866 ++++ b/fs/ext4/namei.c
867 +@@ -3621,7 +3621,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
868 + ext4_encrypted_inode(new.dir) &&
869 + !fscrypt_has_permitted_context(new.dir, old.inode)) {
870 + retval = -EXDEV;
871 +- goto end_rename;
872 ++ goto release_bh;
873 + }
874 +
875 + new.bh = ext4_find_entry(new.dir, &new.dentry->d_name,
876 +diff --git a/net/core/neighbour.c b/net/core/neighbour.c
877 +index d267dc04d9f74..2aa5c231560d2 100644
878 +--- a/net/core/neighbour.c
879 ++++ b/net/core/neighbour.c
880 +@@ -1230,7 +1230,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
881 + * we can reinject the packet there.
882 + */
883 + n2 = NULL;
884 +- if (dst) {
885 ++ if (dst && dst->obsolete != DST_OBSOLETE_DEAD) {
886 + n2 = dst_neigh_lookup_skb(dst, skb);
887 + if (n2)
888 + n1 = n2;
889 +diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
890 +index f07a208ae21fe..cfc01314958f7 100644
891 +--- a/net/ieee802154/nl802154.c
892 ++++ b/net/ieee802154/nl802154.c
893 +@@ -1531,6 +1531,11 @@ nl802154_dump_llsec_key(struct sk_buff *skb, struct netlink_callback *cb)
894 + if (err)
895 + return err;
896 +
897 ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) {
898 ++ err = skb->len;
899 ++ goto out_err;
900 ++ }
901 ++
902 + if (!wpan_dev->netdev) {
903 + err = -EINVAL;
904 + goto out_err;
905 +@@ -1703,6 +1708,11 @@ nl802154_dump_llsec_dev(struct sk_buff *skb, struct netlink_callback *cb)
906 + if (err)
907 + return err;
908 +
909 ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) {
910 ++ err = skb->len;
911 ++ goto out_err;
912 ++ }
913 ++
914 + if (!wpan_dev->netdev) {
915 + err = -EINVAL;
916 + goto out_err;
917 +@@ -1790,6 +1800,9 @@ static int nl802154_add_llsec_dev(struct sk_buff *skb, struct genl_info *info)
918 + struct wpan_dev *wpan_dev = dev->ieee802154_ptr;
919 + struct ieee802154_llsec_device dev_desc;
920 +
921 ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR)
922 ++ return -EOPNOTSUPP;
923 ++
924 + if (ieee802154_llsec_parse_device(info->attrs[NL802154_ATTR_SEC_DEVICE],
925 + &dev_desc) < 0)
926 + return -EINVAL;
927 +@@ -1876,6 +1889,11 @@ nl802154_dump_llsec_devkey(struct sk_buff *skb, struct netlink_callback *cb)
928 + if (err)
929 + return err;
930 +
931 ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) {
932 ++ err = skb->len;
933 ++ goto out_err;
934 ++ }
935 ++
936 + if (!wpan_dev->netdev) {
937 + err = -EINVAL;
938 + goto out_err;
939 +@@ -1933,6 +1951,9 @@ static int nl802154_add_llsec_devkey(struct sk_buff *skb, struct genl_info *info
940 + struct ieee802154_llsec_device_key key;
941 + __le64 extended_addr;
942 +
943 ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR)
944 ++ return -EOPNOTSUPP;
945 ++
946 + if (!info->attrs[NL802154_ATTR_SEC_DEVKEY] ||
947 + nla_parse_nested(attrs, NL802154_DEVKEY_ATTR_MAX,
948 + info->attrs[NL802154_ATTR_SEC_DEVKEY],
949 +@@ -2042,6 +2063,11 @@ nl802154_dump_llsec_seclevel(struct sk_buff *skb, struct netlink_callback *cb)
950 + if (err)
951 + return err;
952 +
953 ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) {
954 ++ err = skb->len;
955 ++ goto out_err;
956 ++ }
957 ++
958 + if (!wpan_dev->netdev) {
959 + err = -EINVAL;
960 + goto out_err;
961 +@@ -2127,6 +2153,9 @@ static int nl802154_add_llsec_seclevel(struct sk_buff *skb,
962 + struct wpan_dev *wpan_dev = dev->ieee802154_ptr;
963 + struct ieee802154_llsec_seclevel sl;
964 +
965 ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR)
966 ++ return -EOPNOTSUPP;
967 ++
968 + if (llsec_parse_seclevel(info->attrs[NL802154_ATTR_SEC_LEVEL],
969 + &sl) < 0)
970 + return -EINVAL;
971 +diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
972 +index a4a5863e482cd..157358a15d599 100644
973 +--- a/net/ipv6/sit.c
974 ++++ b/net/ipv6/sit.c
975 +@@ -1799,9 +1799,9 @@ static void __net_exit sit_destroy_tunnels(struct net *net,
976 + if (dev->rtnl_link_ops == &sit_link_ops)
977 + unregister_netdevice_queue(dev, head);
978 +
979 +- for (prio = 1; prio < 4; prio++) {
980 ++ for (prio = 0; prio < 4; prio++) {
981 + int h;
982 +- for (h = 0; h < IP6_SIT_HASH_SIZE; h++) {
983 ++ for (h = 0; h < (prio ? IP6_SIT_HASH_SIZE : 1); h++) {
984 + struct ip_tunnel *t;
985 +
986 + t = rtnl_dereference(sitn->tunnels[prio][h]);
987 +diff --git a/net/sctp/socket.c b/net/sctp/socket.c
988 +index c0fe647dd4acb..029ec12c77bd7 100644
989 +--- a/net/sctp/socket.c
990 ++++ b/net/sctp/socket.c
991 +@@ -1582,11 +1582,9 @@ static void sctp_close(struct sock *sk, long timeout)
992 +
993 + /* Supposedly, no process has access to the socket, but
994 + * the net layers still may.
995 +- * Also, sctp_destroy_sock() needs to be called with addr_wq_lock
996 +- * held and that should be grabbed before socket lock.
997 + */
998 +- spin_lock_bh(&net->sctp.addr_wq_lock);
999 +- bh_lock_sock_nested(sk);
1000 ++ local_bh_disable();
1001 ++ bh_lock_sock(sk);
1002 +
1003 + /* Hold the sock, since sk_common_release() will put sock_put()
1004 + * and we have just a little more cleanup.
1005 +@@ -1595,7 +1593,7 @@ static void sctp_close(struct sock *sk, long timeout)
1006 + sk_common_release(sk);
1007 +
1008 + bh_unlock_sock(sk);
1009 +- spin_unlock_bh(&net->sctp.addr_wq_lock);
1010 ++ local_bh_enable();
1011 +
1012 + sock_put(sk);
1013 +
1014 +@@ -4262,9 +4260,6 @@ static int sctp_init_sock(struct sock *sk)
1015 + sk_sockets_allocated_inc(sk);
1016 + sock_prot_inuse_add(net, sk->sk_prot, 1);
1017 +
1018 +- /* Nothing can fail after this block, otherwise
1019 +- * sctp_destroy_sock() will be called without addr_wq_lock held
1020 +- */
1021 + if (net->sctp.default_auto_asconf) {
1022 + spin_lock(&sock_net(sk)->sctp.addr_wq_lock);
1023 + list_add_tail(&sp->auto_asconf_list,
1024 +@@ -4299,7 +4294,9 @@ static void sctp_destroy_sock(struct sock *sk)
1025 +
1026 + if (sp->do_auto_asconf) {
1027 + sp->do_auto_asconf = 0;
1028 ++ spin_lock_bh(&sock_net(sk)->sctp.addr_wq_lock);
1029 + list_del(&sp->auto_asconf_list);
1030 ++ spin_unlock_bh(&sock_net(sk)->sctp.addr_wq_lock);
1031 + }
1032 + sctp_endpoint_free(sp->ep);
1033 + local_bh_disable();
1034 +diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
1035 +index fa64cc2b1729f..94bf497092b20 100644
1036 +--- a/sound/soc/fsl/fsl_esai.c
1037 ++++ b/sound/soc/fsl/fsl_esai.c
1038 +@@ -495,11 +495,13 @@ static int fsl_esai_startup(struct snd_pcm_substream *substream,
1039 + ESAI_SAICR_SYNC, esai_priv->synchronous ?
1040 + ESAI_SAICR_SYNC : 0);
1041 +
1042 +- /* Set a default slot number -- 2 */
1043 ++ /* Set slots count */
1044 + regmap_update_bits(esai_priv->regmap, REG_ESAI_TCCR,
1045 +- ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(2));
1046 ++ ESAI_xCCR_xDC_MASK,
1047 ++ ESAI_xCCR_xDC(esai_priv->slots));
1048 + regmap_update_bits(esai_priv->regmap, REG_ESAI_RCCR,
1049 +- ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(2));
1050 ++ ESAI_xCCR_xDC_MASK,
1051 ++ ESAI_xCCR_xDC(esai_priv->slots));
1052 + }
1053 +
1054 + return 0;
1055 +diff --git a/tools/arch/ia64/include/asm/barrier.h b/tools/arch/ia64/include/asm/barrier.h
1056 +index e4422b4b634e6..94ae4a333a35f 100644
1057 +--- a/tools/arch/ia64/include/asm/barrier.h
1058 ++++ b/tools/arch/ia64/include/asm/barrier.h
1059 +@@ -38,9 +38,6 @@
1060 + * sequential memory pages only.
1061 + */
1062 +
1063 +-/* XXX From arch/ia64/include/uapi/asm/gcc_intrin.h */
1064 +-#define ia64_mf() asm volatile ("mf" ::: "memory")
1065 +-
1066 + #define mb() ia64_mf()
1067 + #define rmb() mb()
1068 + #define wmb() mb()