Magellan Linux

Annotation of /trunk/kernel-alx-legacy/patches-4.9/0387-4.9.288-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3689 - (hide annotations) (download)
Mon Oct 24 14:08:04 2022 UTC (19 months, 3 weeks ago) by niro
File size: 42113 byte(s)
-linux-4.9.288
1 niro 3689 diff --git a/Makefile b/Makefile
2     index 76eff0f592346..49568e384a924 100644
3     --- a/Makefile
4     +++ b/Makefile
5     @@ -1,6 +1,6 @@
6     VERSION = 4
7     PATCHLEVEL = 9
8     -SUBLEVEL = 287
9     +SUBLEVEL = 288
10     EXTRAVERSION =
11     NAME = Roaring Lionus
12    
13     diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
14     index 9dbaa283f01db..0f1dbd3238a5e 100644
15     --- a/arch/arm/Kconfig
16     +++ b/arch/arm/Kconfig
17     @@ -55,6 +55,7 @@ config ARM
18     select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
19     select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)
20     select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
21     + select HAVE_FUTEX_CMPXCHG if FUTEX
22     select HAVE_GCC_PLUGINS
23     select HAVE_GENERIC_DMA_COHERENT
24     select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
25     diff --git a/arch/arm/boot/dts/spear3xx.dtsi b/arch/arm/boot/dts/spear3xx.dtsi
26     index 118135d758990..4e4166d96b264 100644
27     --- a/arch/arm/boot/dts/spear3xx.dtsi
28     +++ b/arch/arm/boot/dts/spear3xx.dtsi
29     @@ -53,7 +53,7 @@
30     };
31    
32     gmac: eth@e0800000 {
33     - compatible = "st,spear600-gmac";
34     + compatible = "snps,dwmac-3.40a";
35     reg = <0xe0800000 0x8000>;
36     interrupts = <23 22>;
37     interrupt-names = "macirq", "eth_wake_irq";
38     diff --git a/arch/nios2/include/asm/irqflags.h b/arch/nios2/include/asm/irqflags.h
39     index 75ab92e639f85..0338fcb88203c 100644
40     --- a/arch/nios2/include/asm/irqflags.h
41     +++ b/arch/nios2/include/asm/irqflags.h
42     @@ -22,7 +22,7 @@
43    
44     static inline unsigned long arch_local_save_flags(void)
45     {
46     - return RDCTL(CTL_STATUS);
47     + return RDCTL(CTL_FSTATUS);
48     }
49    
50     /*
51     @@ -31,7 +31,7 @@ static inline unsigned long arch_local_save_flags(void)
52     */
53     static inline void arch_local_irq_restore(unsigned long flags)
54     {
55     - WRCTL(CTL_STATUS, flags);
56     + WRCTL(CTL_FSTATUS, flags);
57     }
58    
59     static inline void arch_local_irq_disable(void)
60     diff --git a/arch/nios2/include/asm/registers.h b/arch/nios2/include/asm/registers.h
61     index 615bce19b546e..33824f2ad1ab7 100644
62     --- a/arch/nios2/include/asm/registers.h
63     +++ b/arch/nios2/include/asm/registers.h
64     @@ -24,7 +24,7 @@
65     #endif
66    
67     /* control register numbers */
68     -#define CTL_STATUS 0
69     +#define CTL_FSTATUS 0
70     #define CTL_ESTATUS 1
71     #define CTL_BSTATUS 2
72     #define CTL_IENABLE 3
73     diff --git a/arch/s390/lib/string.c b/arch/s390/lib/string.c
74     index 48352bffbc929..a82335215d54d 100644
75     --- a/arch/s390/lib/string.c
76     +++ b/arch/s390/lib/string.c
77     @@ -225,14 +225,13 @@ EXPORT_SYMBOL(strcmp);
78     */
79     char * strrchr(const char * s, int c)
80     {
81     - size_t len = __strend(s) - s;
82     -
83     - if (len)
84     - do {
85     - if (s[len] == (char) c)
86     - return (char *) s + len;
87     - } while (--len > 0);
88     - return NULL;
89     + ssize_t len = __strend(s) - s;
90     +
91     + do {
92     + if (s[len] == (char)c)
93     + return (char *)s + len;
94     + } while (--len >= 0);
95     + return NULL;
96     }
97     EXPORT_SYMBOL(strrchr);
98    
99     diff --git a/arch/xtensa/platforms/xtfpga/setup.c b/arch/xtensa/platforms/xtfpga/setup.c
100     index 42285f35d3135..db5122765f166 100644
101     --- a/arch/xtensa/platforms/xtfpga/setup.c
102     +++ b/arch/xtensa/platforms/xtfpga/setup.c
103     @@ -54,8 +54,12 @@ void platform_power_off(void)
104    
105     void platform_restart(void)
106     {
107     - /* Flush and reset the mmu, simulate a processor reset, and
108     - * jump to the reset vector. */
109     + /* Try software reset first. */
110     + WRITE_ONCE(*(u32 *)XTFPGA_SWRST_VADDR, 0xdead);
111     +
112     + /* If software reset did not work, flush and reset the mmu,
113     + * simulate a processor reset, and jump to the reset vector.
114     + */
115     cpu_reset();
116     /* control never gets here */
117     }
118     @@ -85,7 +89,7 @@ void __init platform_calibrate_ccount(void)
119    
120     #endif
121    
122     -#ifdef CONFIG_OF
123     +#ifdef CONFIG_USE_OF
124    
125     static void __init xtfpga_clk_setup(struct device_node *np)
126     {
127     @@ -303,4 +307,4 @@ static int __init xtavnet_init(void)
128     */
129     arch_initcall(xtavnet_init);
130    
131     -#endif /* CONFIG_OF */
132     +#endif /* CONFIG_USE_OF */
133     diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
134     index bce2a8ca4678a..55fcdb798002b 100644
135     --- a/drivers/ata/pata_legacy.c
136     +++ b/drivers/ata/pata_legacy.c
137     @@ -328,7 +328,8 @@ static unsigned int pdc_data_xfer_vlb(struct ata_device *dev,
138     iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
139    
140     if (unlikely(slop)) {
141     - __le32 pad;
142     + __le32 pad = 0;
143     +
144     if (rw == READ) {
145     pad = cpu_to_le32(ioread32(ap->ioaddr.data_addr));
146     memcpy(buf + buflen - slop, &pad, slop);
147     @@ -716,7 +717,8 @@ static unsigned int vlb32_data_xfer(struct ata_device *adev, unsigned char *buf,
148     ioread32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
149    
150     if (unlikely(slop)) {
151     - __le32 pad;
152     + __le32 pad = 0;
153     +
154     if (rw == WRITE) {
155     memcpy(&pad, buf + buflen - slop, slop);
156     iowrite32(le32_to_cpu(pad), ap->ioaddr.data_addr);
157     diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
158     index dc8d2603612ed..91dbc6ae56cf9 100644
159     --- a/drivers/firmware/efi/cper.c
160     +++ b/drivers/firmware/efi/cper.c
161     @@ -35,8 +35,6 @@
162    
163     #define INDENT_SP " "
164    
165     -static char rcd_decode_str[CPER_REC_LEN];
166     -
167     /*
168     * CPER record ID need to be unique even after reboot, because record
169     * ID is used as index for ERST storage, while CPER records from
170     @@ -293,6 +291,7 @@ const char *cper_mem_err_unpack(struct trace_seq *p,
171     struct cper_mem_err_compact *cmem)
172     {
173     const char *ret = trace_seq_buffer_ptr(p);
174     + char rcd_decode_str[CPER_REC_LEN];
175    
176     if (cper_mem_err_location(cmem, rcd_decode_str))
177     trace_seq_printf(p, "%s", rcd_decode_str);
178     @@ -307,6 +306,7 @@ static void cper_print_mem(const char *pfx, const struct cper_sec_mem_err *mem,
179     int len)
180     {
181     struct cper_mem_err_compact cmem;
182     + char rcd_decode_str[CPER_REC_LEN];
183    
184     /* Don't trust UEFI 2.1/2.2 structure with bad validation bits */
185     if (len == sizeof(struct cper_sec_mem_err_old) &&
186     diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c
187     index dd7f63354ca06..60a32440daffe 100644
188     --- a/drivers/firmware/efi/runtime-wrappers.c
189     +++ b/drivers/firmware/efi/runtime-wrappers.c
190     @@ -259,7 +259,7 @@ static void virt_efi_reset_system(int reset_type,
191     unsigned long data_size,
192     efi_char16_t *data)
193     {
194     - if (down_interruptible(&efi_runtime_lock)) {
195     + if (down_trylock(&efi_runtime_lock)) {
196     pr_warn("failed to invoke the reset_system() runtime service:\n"
197     "could not get exclusive access to the firmware\n");
198     return;
199     diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
200     index e49b414c012c6..246336a9f47d6 100644
201     --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
202     +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
203     @@ -439,7 +439,7 @@ static int dsi_bus_clk_enable(struct msm_dsi_host *msm_host)
204    
205     return 0;
206     err:
207     - for (; i > 0; i--)
208     + while (--i >= 0)
209     clk_disable_unprepare(msm_host->bus_clks[i]);
210    
211     return ret;
212     diff --git a/drivers/gpu/drm/msm/edp/edp_ctrl.c b/drivers/gpu/drm/msm/edp/edp_ctrl.c
213     index 149bfe7ddd82d..090ce0a46f068 100644
214     --- a/drivers/gpu/drm/msm/edp/edp_ctrl.c
215     +++ b/drivers/gpu/drm/msm/edp/edp_ctrl.c
216     @@ -1090,7 +1090,7 @@ void msm_edp_ctrl_power(struct edp_ctrl *ctrl, bool on)
217     int msm_edp_ctrl_init(struct msm_edp *edp)
218     {
219     struct edp_ctrl *ctrl = NULL;
220     - struct device *dev = &edp->pdev->dev;
221     + struct device *dev;
222     int ret;
223    
224     if (!edp) {
225     @@ -1098,6 +1098,7 @@ int msm_edp_ctrl_init(struct msm_edp *edp)
226     return -EINVAL;
227     }
228    
229     + dev = &edp->pdev->dev;
230     ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL);
231     if (!ctrl)
232     return -ENOMEM;
233     diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c
234     index 89dfbd31be5c8..b7c7cba2dc092 100644
235     --- a/drivers/iio/adc/ti-adc128s052.c
236     +++ b/drivers/iio/adc/ti-adc128s052.c
237     @@ -169,7 +169,13 @@ static int adc128_probe(struct spi_device *spi)
238     mutex_init(&adc->lock);
239    
240     ret = iio_device_register(indio_dev);
241     + if (ret)
242     + goto err_disable_regulator;
243    
244     + return 0;
245     +
246     +err_disable_regulator:
247     + regulator_disable(adc->reg);
248     return ret;
249     }
250    
251     diff --git a/drivers/iio/common/ssp_sensors/ssp_spi.c b/drivers/iio/common/ssp_sensors/ssp_spi.c
252     index 704284a475aec..645749b90ec07 100644
253     --- a/drivers/iio/common/ssp_sensors/ssp_spi.c
254     +++ b/drivers/iio/common/ssp_sensors/ssp_spi.c
255     @@ -147,7 +147,7 @@ static int ssp_print_mcu_debug(char *data_frame, int *data_index,
256     if (length > received_len - *data_index || length <= 0) {
257     ssp_dbg("[SSP]: MSG From MCU-invalid debug length(%d/%d)\n",
258     length, received_len);
259     - return length ? length : -EPROTO;
260     + return -EPROTO;
261     }
262    
263     ssp_dbg("[SSP]: MSG From MCU - %s\n", &data_frame[*data_index]);
264     @@ -286,6 +286,8 @@ static int ssp_parse_dataframe(struct ssp_data *data, char *dataframe, int len)
265     for (idx = 0; idx < len;) {
266     switch (dataframe[idx++]) {
267     case SSP_MSG2AP_INST_BYPASS_DATA:
268     + if (idx >= len)
269     + return -EPROTO;
270     sd = dataframe[idx++];
271     if (sd < 0 || sd >= SSP_SENSOR_MAX) {
272     dev_err(SSP_DEV,
273     @@ -295,10 +297,13 @@ static int ssp_parse_dataframe(struct ssp_data *data, char *dataframe, int len)
274    
275     if (indio_devs[sd]) {
276     spd = iio_priv(indio_devs[sd]);
277     - if (spd->process_data)
278     + if (spd->process_data) {
279     + if (idx >= len)
280     + return -EPROTO;
281     spd->process_data(indio_devs[sd],
282     &dataframe[idx],
283     data->timestamp);
284     + }
285     } else {
286     dev_err(SSP_DEV, "no client for frame\n");
287     }
288     @@ -306,6 +311,8 @@ static int ssp_parse_dataframe(struct ssp_data *data, char *dataframe, int len)
289     idx += ssp_offset_map[sd];
290     break;
291     case SSP_MSG2AP_INST_DEBUG_DATA:
292     + if (idx >= len)
293     + return -EPROTO;
294     sd = ssp_print_mcu_debug(dataframe, &idx, len);
295     if (sd) {
296     dev_err(SSP_DEV,
297     diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c
298     index be55477de2acc..0a0e52c95ff2d 100644
299     --- a/drivers/iio/light/opt3001.c
300     +++ b/drivers/iio/light/opt3001.c
301     @@ -283,6 +283,8 @@ static int opt3001_get_lux(struct opt3001 *opt, int *val, int *val2)
302     ret = wait_event_timeout(opt->result_ready_queue,
303     opt->result_ready,
304     msecs_to_jiffies(OPT3001_RESULT_READY_LONG));
305     + if (ret == 0)
306     + return -ETIMEDOUT;
307     } else {
308     /* Sleep for result ready time */
309     timeout = (opt->int_time == OPT3001_INT_TIME_SHORT) ?
310     @@ -319,9 +321,7 @@ err:
311     /* Disallow IRQ to access the device while lock is active */
312     opt->ok_to_ignore_lock = false;
313    
314     - if (ret == 0)
315     - return -ETIMEDOUT;
316     - else if (ret < 0)
317     + if (ret < 0)
318     return ret;
319    
320     if (opt->use_irq) {
321     diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
322     index 4168ed0ef187e..f8f6bd92e314c 100644
323     --- a/drivers/input/joystick/xpad.c
324     +++ b/drivers/input/joystick/xpad.c
325     @@ -348,6 +348,7 @@ static const struct xpad_device {
326     { 0x24c6, 0x5b03, "Thrustmaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 },
327     { 0x24c6, 0x5d04, "Razer Sabertooth", 0, XTYPE_XBOX360 },
328     { 0x24c6, 0xfafe, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
329     + { 0x3285, 0x0607, "Nacon GC-100", 0, XTYPE_XBOX360 },
330     { 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX },
331     { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX },
332     { 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN }
333     @@ -464,6 +465,7 @@ static const struct usb_device_id xpad_table[] = {
334     XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA Controllers */
335     XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */
336     XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */
337     + XPAD_XBOX360_VENDOR(0x3285), /* Nacon GC-100 */
338     { }
339     };
340    
341     diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c
342     index 9de62c3b8bf9f..658e116d8fe66 100644
343     --- a/drivers/isdn/capi/kcapi.c
344     +++ b/drivers/isdn/capi/kcapi.c
345     @@ -564,6 +564,11 @@ int detach_capi_ctr(struct capi_ctr *ctr)
346    
347     ctr_down(ctr, CAPI_CTR_DETACHED);
348    
349     + if (ctr->cnr < 1 || ctr->cnr - 1 >= CAPI_MAXCONTR) {
350     + err = -EINVAL;
351     + goto unlock_out;
352     + }
353     +
354     if (capi_controller[ctr->cnr - 1] != ctr) {
355     err = -EINVAL;
356     goto unlock_out;
357     diff --git a/drivers/isdn/hardware/mISDN/netjet.c b/drivers/isdn/hardware/mISDN/netjet.c
358     index 6dea4c180c494..feada9d7cbcc2 100644
359     --- a/drivers/isdn/hardware/mISDN/netjet.c
360     +++ b/drivers/isdn/hardware/mISDN/netjet.c
361     @@ -963,8 +963,8 @@ nj_release(struct tiger_hw *card)
362     nj_disable_hwirq(card);
363     mode_tiger(&card->bc[0], ISDN_P_NONE);
364     mode_tiger(&card->bc[1], ISDN_P_NONE);
365     - card->isac.release(&card->isac);
366     spin_unlock_irqrestore(&card->lock, flags);
367     + card->isac.release(&card->isac);
368     release_region(card->base, card->base_s);
369     card->base_s = 0;
370     }
371     diff --git a/drivers/misc/cb710/sgbuf2.c b/drivers/misc/cb710/sgbuf2.c
372     index 2a40d0efdff5d..4d2a72a537d42 100644
373     --- a/drivers/misc/cb710/sgbuf2.c
374     +++ b/drivers/misc/cb710/sgbuf2.c
375     @@ -50,7 +50,7 @@ static inline bool needs_unaligned_copy(const void *ptr)
376     #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
377     return false;
378     #else
379     - return ((ptr - NULL) & 3) != 0;
380     + return ((uintptr_t)ptr & 3) != 0;
381     #endif
382     }
383    
384     diff --git a/drivers/net/can/rcar/rcar_can.c b/drivers/net/can/rcar/rcar_can.c
385     index 9b2c3bd00f8b4..2ac33ee1067eb 100644
386     --- a/drivers/net/can/rcar/rcar_can.c
387     +++ b/drivers/net/can/rcar/rcar_can.c
388     @@ -858,10 +858,12 @@ static int __maybe_unused rcar_can_suspend(struct device *dev)
389     struct rcar_can_priv *priv = netdev_priv(ndev);
390     u16 ctlr;
391    
392     - if (netif_running(ndev)) {
393     - netif_stop_queue(ndev);
394     - netif_device_detach(ndev);
395     - }
396     + if (!netif_running(ndev))
397     + return 0;
398     +
399     + netif_stop_queue(ndev);
400     + netif_device_detach(ndev);
401     +
402     ctlr = readw(&priv->regs->ctlr);
403     ctlr |= RCAR_CAN_CTLR_CANM_HALT;
404     writew(ctlr, &priv->regs->ctlr);
405     @@ -880,6 +882,9 @@ static int __maybe_unused rcar_can_resume(struct device *dev)
406     u16 ctlr;
407     int err;
408    
409     + if (!netif_running(ndev))
410     + return 0;
411     +
412     err = clk_enable(priv->clk);
413     if (err) {
414     netdev_err(ndev, "clk_enable() failed, error %d\n", err);
415     @@ -893,10 +898,9 @@ static int __maybe_unused rcar_can_resume(struct device *dev)
416     writew(ctlr, &priv->regs->ctlr);
417     priv->can.state = CAN_STATE_ERROR_ACTIVE;
418    
419     - if (netif_running(ndev)) {
420     - netif_device_attach(ndev);
421     - netif_start_queue(ndev);
422     - }
423     + netif_device_attach(ndev);
424     + netif_start_queue(ndev);
425     +
426     return 0;
427     }
428    
429     diff --git a/drivers/net/can/sja1000/peak_pci.c b/drivers/net/can/sja1000/peak_pci.c
430     index 131026fbc2d77..e12fc5d88382d 100644
431     --- a/drivers/net/can/sja1000/peak_pci.c
432     +++ b/drivers/net/can/sja1000/peak_pci.c
433     @@ -736,16 +736,15 @@ static void peak_pci_remove(struct pci_dev *pdev)
434     struct net_device *prev_dev = chan->prev_dev;
435    
436     dev_info(&pdev->dev, "removing device %s\n", dev->name);
437     + /* do that only for first channel */
438     + if (!prev_dev && chan->pciec_card)
439     + peak_pciec_remove(chan->pciec_card);
440     unregister_sja1000dev(dev);
441     free_sja1000dev(dev);
442     dev = prev_dev;
443    
444     - if (!dev) {
445     - /* do that only for first channel */
446     - if (chan->pciec_card)
447     - peak_pciec_remove(chan->pciec_card);
448     + if (!dev)
449     break;
450     - }
451     priv = netdev_priv(dev);
452     chan = priv->priv;
453     }
454     diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c
455     index d314e73f3d061..e7ffc073fbd68 100644
456     --- a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c
457     +++ b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c
458     @@ -559,11 +559,10 @@ static int pcan_usb_fd_decode_status(struct pcan_usb_fd_if *usb_if,
459     } else if (sm->channel_p_w_b & PUCAN_BUS_WARNING) {
460     new_state = CAN_STATE_ERROR_WARNING;
461     } else {
462     - /* no error bit (so, no error skb, back to active state) */
463     - dev->can.state = CAN_STATE_ERROR_ACTIVE;
464     + /* back to (or still in) ERROR_ACTIVE state */
465     + new_state = CAN_STATE_ERROR_ACTIVE;
466     pdev->bec.txerr = 0;
467     pdev->bec.rxerr = 0;
468     - return 0;
469     }
470    
471     /* state hasn't changed */
472     diff --git a/drivers/net/ethernet/Kconfig b/drivers/net/ethernet/Kconfig
473     index 8cc7467b6c1f6..8c80ca4b8ae18 100644
474     --- a/drivers/net/ethernet/Kconfig
475     +++ b/drivers/net/ethernet/Kconfig
476     @@ -96,6 +96,7 @@ config JME
477     config KORINA
478     tristate "Korina (IDT RC32434) Ethernet support"
479     depends on MIKROTIK_RB532
480     + select CRC32
481     ---help---
482     If you have a Mikrotik RouterBoard 500 or IDT RC32434
483     based system say Y. Otherwise say N.
484     diff --git a/drivers/net/ethernet/arc/Kconfig b/drivers/net/ethernet/arc/Kconfig
485     index 689045186064a..ef4988716cf44 100644
486     --- a/drivers/net/ethernet/arc/Kconfig
487     +++ b/drivers/net/ethernet/arc/Kconfig
488     @@ -19,6 +19,7 @@ config ARC_EMAC_CORE
489     tristate
490     select MII
491     select PHYLIB
492     + select CRC32
493    
494     config ARC_EMAC
495     tristate "ARC EMAC support"
496     diff --git a/drivers/net/ethernet/microchip/encx24j600-regmap.c b/drivers/net/ethernet/microchip/encx24j600-regmap.c
497     index f3bb9055a2927..b5de665ce7189 100644
498     --- a/drivers/net/ethernet/microchip/encx24j600-regmap.c
499     +++ b/drivers/net/ethernet/microchip/encx24j600-regmap.c
500     @@ -500,13 +500,19 @@ static struct regmap_bus phymap_encx24j600 = {
501     .reg_read = regmap_encx24j600_phy_reg_read,
502     };
503    
504     -void devm_regmap_init_encx24j600(struct device *dev,
505     - struct encx24j600_context *ctx)
506     +int devm_regmap_init_encx24j600(struct device *dev,
507     + struct encx24j600_context *ctx)
508     {
509     mutex_init(&ctx->mutex);
510     regcfg.lock_arg = ctx;
511     ctx->regmap = devm_regmap_init(dev, &regmap_encx24j600, ctx, &regcfg);
512     + if (IS_ERR(ctx->regmap))
513     + return PTR_ERR(ctx->regmap);
514     ctx->phymap = devm_regmap_init(dev, &phymap_encx24j600, ctx, &phycfg);
515     + if (IS_ERR(ctx->phymap))
516     + return PTR_ERR(ctx->phymap);
517     +
518     + return 0;
519     }
520     EXPORT_SYMBOL_GPL(devm_regmap_init_encx24j600);
521    
522     diff --git a/drivers/net/ethernet/microchip/encx24j600.c b/drivers/net/ethernet/microchip/encx24j600.c
523     index ad661d1979c78..906751f78ef6c 100644
524     --- a/drivers/net/ethernet/microchip/encx24j600.c
525     +++ b/drivers/net/ethernet/microchip/encx24j600.c
526     @@ -1015,10 +1015,13 @@ static int encx24j600_spi_probe(struct spi_device *spi)
527     priv->speed = SPEED_100;
528    
529     priv->ctx.spi = spi;
530     - devm_regmap_init_encx24j600(&spi->dev, &priv->ctx);
531     ndev->irq = spi->irq;
532     ndev->netdev_ops = &encx24j600_netdev_ops;
533    
534     + ret = devm_regmap_init_encx24j600(&spi->dev, &priv->ctx);
535     + if (ret)
536     + goto out_free;
537     +
538     mutex_init(&priv->lock);
539    
540     /* Reset device and check if it is connected */
541     diff --git a/drivers/net/ethernet/microchip/encx24j600_hw.h b/drivers/net/ethernet/microchip/encx24j600_hw.h
542     index 4be73d5553f89..c9b17ccf749ce 100644
543     --- a/drivers/net/ethernet/microchip/encx24j600_hw.h
544     +++ b/drivers/net/ethernet/microchip/encx24j600_hw.h
545     @@ -14,8 +14,8 @@ struct encx24j600_context {
546     int bank;
547     };
548    
549     -void devm_regmap_init_encx24j600(struct device *dev,
550     - struct encx24j600_context *ctx);
551     +int devm_regmap_init_encx24j600(struct device *dev,
552     + struct encx24j600_context *ctx);
553    
554     /* Single-byte instructions */
555     #define BANK_SELECT(bank) (0xC0 | ((bank & (BANK_MASK >> BANK_SHIFT)) << 1))
556     diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
557     index eaa37c079a7cd..a1447d7ff48b5 100644
558     --- a/drivers/net/ethernet/neterion/s2io.c
559     +++ b/drivers/net/ethernet/neterion/s2io.c
560     @@ -8618,7 +8618,7 @@ static void s2io_io_resume(struct pci_dev *pdev)
561     return;
562     }
563    
564     - if (s2io_set_mac_addr(netdev, netdev->dev_addr) == FAILURE) {
565     + if (do_s2io_prog_unicast(netdev, netdev->dev_addr) == FAILURE) {
566     s2io_card_down(sp);
567     pr_err("Can't restore mac addr after reset.\n");
568     return;
569     diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
570     index 92fb664b56fbb..73f97d00ede79 100644
571     --- a/drivers/net/phy/mdio_bus.c
572     +++ b/drivers/net/phy/mdio_bus.c
573     @@ -326,6 +326,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)
574     err = device_register(&bus->dev);
575     if (err) {
576     pr_err("mii_bus %s failed to register\n", bus->id);
577     + put_device(&bus->dev);
578     return -EINVAL;
579     }
580    
581     diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig
582     index 3a7286256db09..9272d0f938190 100644
583     --- a/drivers/net/usb/Kconfig
584     +++ b/drivers/net/usb/Kconfig
585     @@ -98,6 +98,10 @@ config USB_RTL8150
586     config USB_RTL8152
587     tristate "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters"
588     select MII
589     + select CRC32
590     + select CRYPTO
591     + select CRYPTO_HASH
592     + select CRYPTO_SHA256
593     help
594     This option adds support for Realtek RTL8152 based USB 2.0
595     10/100 Ethernet adapters and RTL8153 based USB 3.0 10/100/1000
596     diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
597     index 2a0c5f3b0e509..286196e3a35d3 100644
598     --- a/drivers/nvmem/core.c
599     +++ b/drivers/nvmem/core.c
600     @@ -967,7 +967,8 @@ static inline void nvmem_shift_read_buffer_in_place(struct nvmem_cell *cell,
601     *p-- = 0;
602    
603     /* clear msb bits if any leftover in the last byte */
604     - *p &= GENMASK((cell->nbits%BITS_PER_BYTE) - 1, 0);
605     + if (cell->nbits % BITS_PER_BYTE)
606     + *p &= GENMASK((cell->nbits % BITS_PER_BYTE) - 1, 0);
607     }
608    
609     static int __nvmem_cell_read(struct nvmem_device *nvmem,
610     diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
611     index e81daff65f622..238ee4275f5c8 100644
612     --- a/drivers/platform/x86/intel_scu_ipc.c
613     +++ b/drivers/platform/x86/intel_scu_ipc.c
614     @@ -187,7 +187,7 @@ static inline int busy_loop(struct intel_scu_ipc_dev *scu)
615     return 0;
616     }
617    
618     -/* Wait till ipc ioc interrupt is received or timeout in 3 HZ */
619     +/* Wait till ipc ioc interrupt is received or timeout in 10 HZ */
620     static inline int ipc_wait_for_interrupt(struct intel_scu_ipc_dev *scu)
621     {
622     int status;
623     diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
624     index bb63cc5cbca05..ae67f6383ca32 100644
625     --- a/drivers/usb/host/xhci-pci.c
626     +++ b/drivers/usb/host/xhci-pci.c
627     @@ -38,6 +38,7 @@
628     #define PCI_VENDOR_ID_FRESCO_LOGIC 0x1b73
629     #define PCI_DEVICE_ID_FRESCO_LOGIC_PDK 0x1000
630     #define PCI_DEVICE_ID_FRESCO_LOGIC_FL1009 0x1009
631     +#define PCI_DEVICE_ID_FRESCO_LOGIC_FL1100 0x1100
632     #define PCI_DEVICE_ID_FRESCO_LOGIC_FL1400 0x1400
633    
634     #define PCI_VENDOR_ID_ETRON 0x1b6f
635     @@ -91,6 +92,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
636     /* Look for vendor-specific quirks */
637     if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC &&
638     (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK ||
639     + pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1100 ||
640     pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1400)) {
641     if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK &&
642     pdev->revision == 0x0) {
643     diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
644     index ec8ad931f41e3..9a0f8ee8cbd9f 100644
645     --- a/drivers/usb/serial/option.c
646     +++ b/drivers/usb/serial/option.c
647     @@ -1209,6 +1209,8 @@ static const struct usb_device_id option_ids[] = {
648     .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
649     { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1203, 0xff), /* Telit LE910Cx (RNDIS) */
650     .driver_info = NCTRL(2) | RSVD(3) },
651     + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1204, 0xff), /* Telit LE910Cx (MBIM) */
652     + .driver_info = NCTRL(0) | RSVD(1) },
653     { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4),
654     .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) | RSVD(3) },
655     { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920),
656     diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
657     index 11fb4d78e2dbc..f0bd6a66f551e 100644
658     --- a/drivers/usb/serial/qcserial.c
659     +++ b/drivers/usb/serial/qcserial.c
660     @@ -169,6 +169,7 @@ static const struct usb_device_id id_table[] = {
661     {DEVICE_SWI(0x1199, 0x907b)}, /* Sierra Wireless EM74xx */
662     {DEVICE_SWI(0x1199, 0x9090)}, /* Sierra Wireless EM7565 QDL */
663     {DEVICE_SWI(0x1199, 0x9091)}, /* Sierra Wireless EM7565 */
664     + {DEVICE_SWI(0x1199, 0x90d2)}, /* Sierra Wireless EM9191 QDL */
665     {DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */
666     {DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */
667     {DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */
668     diff --git a/fs/exec.c b/fs/exec.c
669     index 319a1f5732fa9..482a8b4f41a5b 100644
670     --- a/fs/exec.c
671     +++ b/fs/exec.c
672     @@ -994,7 +994,7 @@ int kernel_read_file_from_fd(int fd, void **buf, loff_t *size, loff_t max_size,
673     struct fd f = fdget(fd);
674     int ret = -EBADF;
675    
676     - if (!f.file)
677     + if (!f.file || !(f.file->f_mode & FMODE_READ))
678     goto out;
679    
680     ret = kernel_read_file(f.file, buf, size, max_size, id);
681     diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
682     index f704f90db36cd..2418b9d829ae1 100644
683     --- a/fs/nfsd/nfsctl.c
684     +++ b/fs/nfsd/nfsctl.c
685     @@ -765,7 +765,10 @@ out_close:
686     svc_xprt_put(xprt);
687     }
688     out_err:
689     - nfsd_destroy(net);
690     + if (!list_empty(&nn->nfsd_serv->sv_permsocks))
691     + nn->nfsd_serv->sv_nrthreads--;
692     + else
693     + nfsd_destroy(net);
694     return err;
695     }
696    
697     diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
698     index dfb8a923921e0..04bb03b01f62d 100644
699     --- a/fs/ocfs2/alloc.c
700     +++ b/fs/ocfs2/alloc.c
701     @@ -6891,7 +6891,7 @@ void ocfs2_set_inode_data_inline(struct inode *inode, struct ocfs2_dinode *di)
702     int ocfs2_convert_inline_data_to_extents(struct inode *inode,
703     struct buffer_head *di_bh)
704     {
705     - int ret, i, has_data, num_pages = 0;
706     + int ret, has_data, num_pages = 0;
707     int need_free = 0;
708     u32 bit_off, num;
709     handle_t *handle;
710     @@ -6900,26 +6900,17 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode,
711     struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
712     struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data;
713     struct ocfs2_alloc_context *data_ac = NULL;
714     - struct page **pages = NULL;
715     - loff_t end = osb->s_clustersize;
716     + struct page *page = NULL;
717     struct ocfs2_extent_tree et;
718     int did_quota = 0;
719    
720     has_data = i_size_read(inode) ? 1 : 0;
721    
722     if (has_data) {
723     - pages = kcalloc(ocfs2_pages_per_cluster(osb->sb),
724     - sizeof(struct page *), GFP_NOFS);
725     - if (pages == NULL) {
726     - ret = -ENOMEM;
727     - mlog_errno(ret);
728     - return ret;
729     - }
730     -
731     ret = ocfs2_reserve_clusters(osb, 1, &data_ac);
732     if (ret) {
733     mlog_errno(ret);
734     - goto free_pages;
735     + goto out;
736     }
737     }
738    
739     @@ -6939,7 +6930,8 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode,
740     }
741    
742     if (has_data) {
743     - unsigned int page_end;
744     + unsigned int page_end = min_t(unsigned, PAGE_SIZE,
745     + osb->s_clustersize);
746     u64 phys;
747    
748     ret = dquot_alloc_space_nodirty(inode,
749     @@ -6963,15 +6955,8 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode,
750     */
751     block = phys = ocfs2_clusters_to_blocks(inode->i_sb, bit_off);
752    
753     - /*
754     - * Non sparse file systems zero on extend, so no need
755     - * to do that now.
756     - */
757     - if (!ocfs2_sparse_alloc(osb) &&
758     - PAGE_SIZE < osb->s_clustersize)
759     - end = PAGE_SIZE;
760     -
761     - ret = ocfs2_grab_eof_pages(inode, 0, end, pages, &num_pages);
762     + ret = ocfs2_grab_eof_pages(inode, 0, page_end, &page,
763     + &num_pages);
764     if (ret) {
765     mlog_errno(ret);
766     need_free = 1;
767     @@ -6982,20 +6967,15 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode,
768     * This should populate the 1st page for us and mark
769     * it up to date.
770     */
771     - ret = ocfs2_read_inline_data(inode, pages[0], di_bh);
772     + ret = ocfs2_read_inline_data(inode, page, di_bh);
773     if (ret) {
774     mlog_errno(ret);
775     need_free = 1;
776     goto out_unlock;
777     }
778    
779     - page_end = PAGE_SIZE;
780     - if (PAGE_SIZE > osb->s_clustersize)
781     - page_end = osb->s_clustersize;
782     -
783     - for (i = 0; i < num_pages; i++)
784     - ocfs2_map_and_dirty_page(inode, handle, 0, page_end,
785     - pages[i], i > 0, &phys);
786     + ocfs2_map_and_dirty_page(inode, handle, 0, page_end, page, 0,
787     + &phys);
788     }
789    
790     spin_lock(&oi->ip_lock);
791     @@ -7026,8 +7006,8 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode,
792     }
793    
794     out_unlock:
795     - if (pages)
796     - ocfs2_unlock_and_free_pages(pages, num_pages);
797     + if (page)
798     + ocfs2_unlock_and_free_pages(&page, num_pages);
799    
800     out_commit:
801     if (ret < 0 && did_quota)
802     @@ -7051,8 +7031,6 @@ out_commit:
803     out:
804     if (data_ac)
805     ocfs2_free_alloc_context(data_ac);
806     -free_pages:
807     - kfree(pages);
808     return ret;
809     }
810    
811     diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
812     index e0fb62f5cf63d..454aad87b866c 100644
813     --- a/fs/ocfs2/super.c
814     +++ b/fs/ocfs2/super.c
815     @@ -2189,11 +2189,17 @@ static int ocfs2_initialize_super(struct super_block *sb,
816     }
817    
818     if (ocfs2_clusterinfo_valid(osb)) {
819     + /*
820     + * ci_stack and ci_cluster in ocfs2_cluster_info may not be null
821     + * terminated, so make sure no overflow happens here by using
822     + * memcpy. Destination strings will always be null terminated
823     + * because osb is allocated using kzalloc.
824     + */
825     osb->osb_stackflags =
826     OCFS2_RAW_SB(di)->s_cluster_info.ci_stackflags;
827     - strlcpy(osb->osb_cluster_stack,
828     + memcpy(osb->osb_cluster_stack,
829     OCFS2_RAW_SB(di)->s_cluster_info.ci_stack,
830     - OCFS2_STACK_LABEL_LEN + 1);
831     + OCFS2_STACK_LABEL_LEN);
832     if (strlen(osb->osb_cluster_stack) != OCFS2_STACK_LABEL_LEN) {
833     mlog(ML_ERROR,
834     "couldn't mount because of an invalid "
835     @@ -2202,9 +2208,9 @@ static int ocfs2_initialize_super(struct super_block *sb,
836     status = -EINVAL;
837     goto bail;
838     }
839     - strlcpy(osb->osb_cluster_name,
840     + memcpy(osb->osb_cluster_name,
841     OCFS2_RAW_SB(di)->s_cluster_info.ci_cluster,
842     - OCFS2_CLUSTER_NAME_LEN + 1);
843     + OCFS2_CLUSTER_NAME_LEN);
844     } else {
845     /* The empty string is identical with classic tools that
846     * don't know about s_cluster_info. */
847     diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
848     index 4adf7faeaeb59..a65dadad65bf8 100644
849     --- a/include/linux/elfcore.h
850     +++ b/include/linux/elfcore.h
851     @@ -55,7 +55,7 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse
852     }
853     #endif
854    
855     -#if defined(CONFIG_UM) || defined(CONFIG_IA64)
856     +#if (defined(CONFIG_UML) && defined(CONFIG_X86_32)) || defined(CONFIG_IA64)
857     /*
858     * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out
859     * extra segments containing the gate DSO contents. Dumping its
860     diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
861     index 84f2caf6a6991..06841602025ef 100644
862     --- a/kernel/trace/ftrace.c
863     +++ b/kernel/trace/ftrace.c
864     @@ -5288,7 +5288,7 @@ __ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip,
865     struct ftrace_ops *op;
866     int bit;
867    
868     - bit = trace_test_and_set_recursion(TRACE_LIST_START, TRACE_LIST_MAX);
869     + bit = trace_test_and_set_recursion(TRACE_LIST_START);
870     if (bit < 0)
871     return;
872    
873     @@ -5363,7 +5363,7 @@ static void ftrace_ops_assist_func(unsigned long ip, unsigned long parent_ip,
874     {
875     int bit;
876    
877     - bit = trace_test_and_set_recursion(TRACE_LIST_START, TRACE_LIST_MAX);
878     + bit = trace_test_and_set_recursion(TRACE_LIST_START);
879     if (bit < 0)
880     return;
881    
882     diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
883     index d9b7910ef3658..ecea27ba29e68 100644
884     --- a/kernel/trace/trace.h
885     +++ b/kernel/trace/trace.h
886     @@ -446,23 +446,8 @@ struct tracer {
887     * When function tracing occurs, the following steps are made:
888     * If arch does not support a ftrace feature:
889     * call internal function (uses INTERNAL bits) which calls...
890     - * If callback is registered to the "global" list, the list
891     - * function is called and recursion checks the GLOBAL bits.
892     - * then this function calls...
893     * The function callback, which can use the FTRACE bits to
894     * check for recursion.
895     - *
896     - * Now if the arch does not suppport a feature, and it calls
897     - * the global list function which calls the ftrace callback
898     - * all three of these steps will do a recursion protection.
899     - * There's no reason to do one if the previous caller already
900     - * did. The recursion that we are protecting against will
901     - * go through the same steps again.
902     - *
903     - * To prevent the multiple recursion checks, if a recursion
904     - * bit is set that is higher than the MAX bit of the current
905     - * check, then we know that the check was made by the previous
906     - * caller, and we can skip the current check.
907     */
908     enum {
909     TRACE_BUFFER_BIT,
910     @@ -475,12 +460,14 @@ enum {
911     TRACE_FTRACE_NMI_BIT,
912     TRACE_FTRACE_IRQ_BIT,
913     TRACE_FTRACE_SIRQ_BIT,
914     + TRACE_FTRACE_TRANSITION_BIT,
915    
916     - /* INTERNAL_BITs must be greater than FTRACE_BITs */
917     + /* Internal use recursion bits */
918     TRACE_INTERNAL_BIT,
919     TRACE_INTERNAL_NMI_BIT,
920     TRACE_INTERNAL_IRQ_BIT,
921     TRACE_INTERNAL_SIRQ_BIT,
922     + TRACE_INTERNAL_TRANSITION_BIT,
923    
924     TRACE_BRANCH_BIT,
925     /*
926     @@ -491,12 +478,6 @@ enum {
927     * can only be modified by current, we can reuse trace_recursion.
928     */
929     TRACE_IRQ_BIT,
930     -
931     - /*
932     - * When transitioning between context, the preempt_count() may
933     - * not be correct. Allow for a single recursion to cover this case.
934     - */
935     - TRACE_TRANSITION_BIT,
936     };
937    
938     #define trace_recursion_set(bit) do { (current)->trace_recursion |= (1<<(bit)); } while (0)
939     @@ -506,12 +487,18 @@ enum {
940     #define TRACE_CONTEXT_BITS 4
941    
942     #define TRACE_FTRACE_START TRACE_FTRACE_BIT
943     -#define TRACE_FTRACE_MAX ((1 << (TRACE_FTRACE_START + TRACE_CONTEXT_BITS)) - 1)
944    
945     #define TRACE_LIST_START TRACE_INTERNAL_BIT
946     -#define TRACE_LIST_MAX ((1 << (TRACE_LIST_START + TRACE_CONTEXT_BITS)) - 1)
947    
948     -#define TRACE_CONTEXT_MASK TRACE_LIST_MAX
949     +#define TRACE_CONTEXT_MASK ((1 << (TRACE_LIST_START + TRACE_CONTEXT_BITS)) - 1)
950     +
951     +enum {
952     + TRACE_CTX_NMI,
953     + TRACE_CTX_IRQ,
954     + TRACE_CTX_SOFTIRQ,
955     + TRACE_CTX_NORMAL,
956     + TRACE_CTX_TRANSITION,
957     +};
958    
959     static __always_inline int trace_get_context_bit(void)
960     {
961     @@ -519,59 +506,48 @@ static __always_inline int trace_get_context_bit(void)
962    
963     if (in_interrupt()) {
964     if (in_nmi())
965     - bit = 0;
966     + bit = TRACE_CTX_NMI;
967    
968     else if (in_irq())
969     - bit = 1;
970     + bit = TRACE_CTX_IRQ;
971     else
972     - bit = 2;
973     + bit = TRACE_CTX_SOFTIRQ;
974     } else
975     - bit = 3;
976     + bit = TRACE_CTX_NORMAL;
977    
978     return bit;
979     }
980    
981     -static __always_inline int trace_test_and_set_recursion(int start, int max)
982     +static __always_inline int trace_test_and_set_recursion(int start)
983     {
984     unsigned int val = current->trace_recursion;
985     int bit;
986    
987     - /* A previous recursion check was made */
988     - if ((val & TRACE_CONTEXT_MASK) > max)
989     - return 0;
990     -
991     bit = trace_get_context_bit() + start;
992     if (unlikely(val & (1 << bit))) {
993     /*
994     * It could be that preempt_count has not been updated during
995     * a switch between contexts. Allow for a single recursion.
996     */
997     - bit = TRACE_TRANSITION_BIT;
998     + bit = start + TRACE_CTX_TRANSITION;
999     if (trace_recursion_test(bit))
1000     return -1;
1001     trace_recursion_set(bit);
1002     barrier();
1003     - return bit + 1;
1004     + return bit;
1005     }
1006    
1007     - /* Normal check passed, clear the transition to allow it again */
1008     - trace_recursion_clear(TRACE_TRANSITION_BIT);
1009     -
1010     val |= 1 << bit;
1011     current->trace_recursion = val;
1012     barrier();
1013    
1014     - return bit + 1;
1015     + return bit;
1016     }
1017    
1018     static __always_inline void trace_clear_recursion(int bit)
1019     {
1020     unsigned int val = current->trace_recursion;
1021    
1022     - if (!bit)
1023     - return;
1024     -
1025     - bit--;
1026     bit = 1 << bit;
1027     val &= ~bit;
1028    
1029     diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
1030     index 0efa00d80623d..9434d2fe932f5 100644
1031     --- a/kernel/trace/trace_functions.c
1032     +++ b/kernel/trace/trace_functions.c
1033     @@ -137,7 +137,7 @@ function_trace_call(unsigned long ip, unsigned long parent_ip,
1034     pc = preempt_count();
1035     preempt_disable_notrace();
1036    
1037     - bit = trace_test_and_set_recursion(TRACE_FTRACE_START, TRACE_FTRACE_MAX);
1038     + bit = trace_test_and_set_recursion(TRACE_FTRACE_START);
1039     if (bit < 0)
1040     goto out;
1041    
1042     diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
1043     index e8d56d9a4df2c..dacd2d34a790b 100644
1044     --- a/net/netfilter/Kconfig
1045     +++ b/net/netfilter/Kconfig
1046     @@ -71,7 +71,7 @@ config NF_CONNTRACK_MARK
1047     config NF_CONNTRACK_SECMARK
1048     bool 'Connection tracking security mark support'
1049     depends on NETWORK_SECMARK
1050     - default m if NETFILTER_ADVANCED=n
1051     + default y if NETFILTER_ADVANCED=n
1052     help
1053     This option enables security markings to be applied to
1054     connections. Typically they are copied to connections from
1055     diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
1056     index 4e08305a55c48..3ee198b3bfe28 100644
1057     --- a/net/netfilter/ipvs/ip_vs_ctl.c
1058     +++ b/net/netfilter/ipvs/ip_vs_ctl.c
1059     @@ -3987,6 +3987,11 @@ static int __net_init ip_vs_control_net_init_sysctl(struct netns_ipvs *ipvs)
1060     tbl[idx++].data = &ipvs->sysctl_conn_reuse_mode;
1061     tbl[idx++].data = &ipvs->sysctl_schedule_icmp;
1062     tbl[idx++].data = &ipvs->sysctl_ignore_tunneled;
1063     +#ifdef CONFIG_IP_VS_DEBUG
1064     + /* Global sysctls must be ro in non-init netns */
1065     + if (!net_eq(net, &init_net))
1066     + tbl[idx++].mode = 0444;
1067     +#endif
1068    
1069     ipvs->sysctl_hdr = register_net_sysctl(net, "net/ipv4/vs", tbl);
1070     if (ipvs->sysctl_hdr == NULL) {
1071     diff --git a/net/nfc/af_nfc.c b/net/nfc/af_nfc.c
1072     index 54e40fa478226..1859b8e98ded2 100644
1073     --- a/net/nfc/af_nfc.c
1074     +++ b/net/nfc/af_nfc.c
1075     @@ -72,6 +72,9 @@ int nfc_proto_register(const struct nfc_protocol *nfc_proto)
1076     proto_tab[nfc_proto->id] = nfc_proto;
1077     write_unlock(&proto_tab_lock);
1078    
1079     + if (rc)
1080     + proto_unregister(nfc_proto->proto);
1081     +
1082     return rc;
1083     }
1084     EXPORT_SYMBOL(nfc_proto_register);
1085     diff --git a/net/nfc/digital_core.c b/net/nfc/digital_core.c
1086     index 0fd5518bf2522..8d083037f05bf 100644
1087     --- a/net/nfc/digital_core.c
1088     +++ b/net/nfc/digital_core.c
1089     @@ -286,6 +286,7 @@ int digital_tg_configure_hw(struct nfc_digital_dev *ddev, int type, int param)
1090     static int digital_tg_listen_mdaa(struct nfc_digital_dev *ddev, u8 rf_tech)
1091     {
1092     struct digital_tg_mdaa_params *params;
1093     + int rc;
1094    
1095     params = kzalloc(sizeof(struct digital_tg_mdaa_params), GFP_KERNEL);
1096     if (!params)
1097     @@ -300,8 +301,12 @@ static int digital_tg_listen_mdaa(struct nfc_digital_dev *ddev, u8 rf_tech)
1098     get_random_bytes(params->nfcid2 + 2, NFC_NFCID2_MAXSIZE - 2);
1099     params->sc = DIGITAL_SENSF_FELICA_SC;
1100    
1101     - return digital_send_cmd(ddev, DIGITAL_CMD_TG_LISTEN_MDAA, NULL, params,
1102     - 500, digital_tg_recv_atr_req, NULL);
1103     + rc = digital_send_cmd(ddev, DIGITAL_CMD_TG_LISTEN_MDAA, NULL, params,
1104     + 500, digital_tg_recv_atr_req, NULL);
1105     + if (rc)
1106     + kfree(params);
1107     +
1108     + return rc;
1109     }
1110    
1111     static int digital_tg_listen_md(struct nfc_digital_dev *ddev, u8 rf_tech)
1112     diff --git a/net/nfc/digital_technology.c b/net/nfc/digital_technology.c
1113     index d9080dec5d278..76622b3678fbb 100644
1114     --- a/net/nfc/digital_technology.c
1115     +++ b/net/nfc/digital_technology.c
1116     @@ -473,8 +473,12 @@ static int digital_in_send_sdd_req(struct nfc_digital_dev *ddev,
1117     *skb_put(skb, sizeof(u8)) = sel_cmd;
1118     *skb_put(skb, sizeof(u8)) = DIGITAL_SDD_REQ_SEL_PAR;
1119    
1120     - return digital_in_send_cmd(ddev, skb, 30, digital_in_recv_sdd_res,
1121     - target);
1122     + rc = digital_in_send_cmd(ddev, skb, 30, digital_in_recv_sdd_res,
1123     + target);
1124     + if (rc)
1125     + kfree_skb(skb);
1126     +
1127     + return rc;
1128     }
1129    
1130     static void digital_in_recv_sens_res(struct nfc_digital_dev *ddev, void *arg,
1131     diff --git a/net/nfc/nci/rsp.c b/net/nfc/nci/rsp.c
1132     index e3bbf1937d0e9..7681f89dc312b 100644
1133     --- a/net/nfc/nci/rsp.c
1134     +++ b/net/nfc/nci/rsp.c
1135     @@ -289,6 +289,8 @@ static void nci_core_conn_close_rsp_packet(struct nci_dev *ndev,
1136     ndev->cur_conn_id);
1137     if (conn_info) {
1138     list_del(&conn_info->list);
1139     + if (conn_info == ndev->rf_conn_info)
1140     + ndev->rf_conn_info = NULL;
1141     devm_kfree(&ndev->nfc_dev->dev, conn_info);
1142     }
1143     }
1144     diff --git a/sound/core/seq/seq_device.c b/sound/core/seq/seq_device.c
1145     index e40a2cba5002a..5d16b20791195 100644
1146     --- a/sound/core/seq/seq_device.c
1147     +++ b/sound/core/seq/seq_device.c
1148     @@ -162,6 +162,8 @@ static int snd_seq_device_dev_free(struct snd_device *device)
1149     struct snd_seq_device *dev = device->device_data;
1150    
1151     cancel_autoload_drivers();
1152     + if (dev->private_free)
1153     + dev->private_free(dev);
1154     put_device(&dev->dev);
1155     return 0;
1156     }
1157     @@ -189,11 +191,7 @@ static int snd_seq_device_dev_disconnect(struct snd_device *device)
1158    
1159     static void snd_seq_dev_release(struct device *dev)
1160     {
1161     - struct snd_seq_device *sdev = to_seq_dev(dev);
1162     -
1163     - if (sdev->private_free)
1164     - sdev->private_free(sdev);
1165     - kfree(sdev);
1166     + kfree(to_seq_dev(dev));
1167     }
1168    
1169     /*
1170     diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c
1171     index 00c6af2ae1c29..f0e112906c687 100644
1172     --- a/sound/hda/hdac_controller.c
1173     +++ b/sound/hda/hdac_controller.c
1174     @@ -389,8 +389,9 @@ static int azx_reset(struct hdac_bus *bus, bool full_reset)
1175     if (!full_reset)
1176     goto skip_reset;
1177    
1178     - /* clear STATESTS */
1179     - snd_hdac_chip_writew(bus, STATESTS, STATESTS_INT_MASK);
1180     + /* clear STATESTS if not in reset */
1181     + if (snd_hdac_chip_readb(bus, GCTL) & AZX_GCTL_RESET)
1182     + snd_hdac_chip_writew(bus, STATESTS, STATESTS_INT_MASK);
1183    
1184     /* reset controller */
1185     snd_hdac_bus_enter_link_reset(bus);
1186     diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
1187     index 11edb6f6bdafe..5451705f429e0 100644
1188     --- a/sound/soc/soc-dapm.c
1189     +++ b/sound/soc/soc-dapm.c
1190     @@ -2410,6 +2410,7 @@ static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm,
1191     const char *pin, int status)
1192     {
1193     struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true);
1194     + int ret = 0;
1195    
1196     dapm_assert_locked(dapm);
1197    
1198     @@ -2422,13 +2423,14 @@ static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm,
1199     dapm_mark_dirty(w, "pin configuration");
1200     dapm_widget_invalidate_input_paths(w);
1201     dapm_widget_invalidate_output_paths(w);
1202     + ret = 1;
1203     }
1204    
1205     w->connected = status;
1206     if (status == 0)
1207     w->force = 0;
1208    
1209     - return 0;
1210     + return ret;
1211     }
1212    
1213     /**
1214     @@ -3323,14 +3325,15 @@ int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol,
1215     {
1216     struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
1217     const char *pin = (const char *)kcontrol->private_value;
1218     + int ret;
1219    
1220     if (ucontrol->value.integer.value[0])
1221     - snd_soc_dapm_enable_pin(&card->dapm, pin);
1222     + ret = snd_soc_dapm_enable_pin(&card->dapm, pin);
1223     else
1224     - snd_soc_dapm_disable_pin(&card->dapm, pin);
1225     + ret = snd_soc_dapm_disable_pin(&card->dapm, pin);
1226    
1227     snd_soc_dapm_sync(&card->dapm);
1228     - return 0;
1229     + return ret;
1230     }
1231     EXPORT_SYMBOL_GPL(snd_soc_dapm_put_pin_switch);
1232    
1233     @@ -3706,7 +3709,7 @@ static int snd_soc_dapm_dai_link_put(struct snd_kcontrol *kcontrol,
1234    
1235     w->params_select = ucontrol->value.enumerated.item[0];
1236    
1237     - return 0;
1238     + return 1;
1239     }
1240    
1241     int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
1242     diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
1243     index d3d3e05fe5b8d..1904fc542025d 100644
1244     --- a/sound/usb/quirks-table.h
1245     +++ b/sound/usb/quirks-table.h
1246     @@ -3446,5 +3446,37 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"),
1247     }
1248     }
1249     },
1250     +{
1251     + /*
1252     + * Sennheiser GSP670
1253     + * Change order of interfaces loaded
1254     + */
1255     + USB_DEVICE(0x1395, 0x0300),
1256     + .bInterfaceClass = USB_CLASS_PER_INTERFACE,
1257     + .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
1258     + .ifnum = QUIRK_ANY_INTERFACE,
1259     + .type = QUIRK_COMPOSITE,
1260     + .data = &(const struct snd_usb_audio_quirk[]) {
1261     + // Communication
1262     + {
1263     + .ifnum = 3,
1264     + .type = QUIRK_AUDIO_STANDARD_INTERFACE
1265     + },
1266     + // Recording
1267     + {
1268     + .ifnum = 4,
1269     + .type = QUIRK_AUDIO_STANDARD_INTERFACE
1270     + },
1271     + // Main
1272     + {
1273     + .ifnum = 1,
1274     + .type = QUIRK_AUDIO_STANDARD_INTERFACE
1275     + },
1276     + {
1277     + .ifnum = -1
1278     + }
1279     + }
1280     + }
1281     +},
1282    
1283     #undef USB_DEVICE_VENDOR_SPEC