Magellan Linux

Annotation of /trunk/kernel-alx/patches-4.9/0209-4.9.110-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3186 - (hide annotations) (download)
Wed Aug 8 14:17:37 2018 UTC (5 years, 10 months ago) by niro
File size: 37441 byte(s)
-linux-4.9.110
1 niro 3186 diff --git a/Documentation/devicetree/bindings/net/dsa/b53.txt b/Documentation/devicetree/bindings/net/dsa/b53.txt
2     index d6c6e41648d4..6192f02af2a9 100644
3     --- a/Documentation/devicetree/bindings/net/dsa/b53.txt
4     +++ b/Documentation/devicetree/bindings/net/dsa/b53.txt
5     @@ -10,6 +10,7 @@ Required properties:
6     "brcm,bcm53128"
7     "brcm,bcm5365"
8     "brcm,bcm5395"
9     + "brcm,bcm5389"
10     "brcm,bcm5397"
11     "brcm,bcm5398"
12    
13     diff --git a/Makefile b/Makefile
14     index 1570cc85313d..2fcfe1147eaa 100644
15     --- a/Makefile
16     +++ b/Makefile
17     @@ -1,6 +1,6 @@
18     VERSION = 4
19     PATCHLEVEL = 9
20     -SUBLEVEL = 109
21     +SUBLEVEL = 110
22     EXTRAVERSION =
23     NAME = Roaring Lionus
24    
25     diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
26     index 0e2c0ac5792d..82c59a143a14 100644
27     --- a/drivers/ata/libata-core.c
28     +++ b/drivers/ata/libata-core.c
29     @@ -4426,9 +4426,6 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
30     ATA_HORKAGE_ZERO_AFTER_TRIM |
31     ATA_HORKAGE_NOLPM, },
32    
33     - /* Sandisk devices which are known to not handle LPM well */
34     - { "SanDisk SD7UB3Q*G1001", NULL, ATA_HORKAGE_NOLPM, },
35     -
36     /* devices that don't properly handle queued TRIM commands */
37     { "Micron_M500IT_*", "MU01", ATA_HORKAGE_NO_NCQ_TRIM |
38     ATA_HORKAGE_ZERO_AFTER_TRIM, },
39     diff --git a/drivers/ata/libata-zpodd.c b/drivers/ata/libata-zpodd.c
40     index f3a65a3140d3..0ad96c647541 100644
41     --- a/drivers/ata/libata-zpodd.c
42     +++ b/drivers/ata/libata-zpodd.c
43     @@ -34,7 +34,7 @@ struct zpodd {
44     static int eject_tray(struct ata_device *dev)
45     {
46     struct ata_taskfile tf;
47     - const char cdb[] = { GPCMD_START_STOP_UNIT,
48     + static const char cdb[ATAPI_CDB_LEN] = { GPCMD_START_STOP_UNIT,
49     0, 0, 0,
50     0x02, /* LoEj */
51     0, 0, 0, 0, 0, 0, 0,
52     @@ -55,7 +55,7 @@ static enum odd_mech_type zpodd_get_mech_type(struct ata_device *dev)
53     unsigned int ret;
54     struct rm_feature_desc *desc = (void *)(buf + 8);
55     struct ata_taskfile tf;
56     - char cdb[] = { GPCMD_GET_CONFIGURATION,
57     + static const char cdb[] = { GPCMD_GET_CONFIGURATION,
58     2, /* only 1 feature descriptor requested */
59     0, 3, /* 3, removable medium feature */
60     0, 0, 0,/* reserved */
61     diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
62     index 81bfeec67b77..d0fac641e717 100644
63     --- a/drivers/atm/zatm.c
64     +++ b/drivers/atm/zatm.c
65     @@ -1151,8 +1151,8 @@ static void eprom_get_byte(struct zatm_dev *zatm_dev, unsigned char *byte,
66     }
67    
68    
69     -static unsigned char eprom_try_esi(struct atm_dev *dev, unsigned short cmd,
70     - int offset, int swap)
71     +static int eprom_try_esi(struct atm_dev *dev, unsigned short cmd, int offset,
72     + int swap)
73     {
74     unsigned char buf[ZEPROM_SIZE];
75     struct zatm_dev *zatm_dev;
76     diff --git a/drivers/base/core.c b/drivers/base/core.c
77     index 03a82d017cf1..a0ed957d738f 100644
78     --- a/drivers/base/core.c
79     +++ b/drivers/base/core.c
80     @@ -759,7 +759,7 @@ class_dir_create_and_add(struct class *class, struct kobject *parent_kobj)
81    
82     dir = kzalloc(sizeof(*dir), GFP_KERNEL);
83     if (!dir)
84     - return NULL;
85     + return ERR_PTR(-ENOMEM);
86    
87     dir->class = class;
88     kobject_init(&dir->kobj, &class_dir_ktype);
89     @@ -769,7 +769,7 @@ class_dir_create_and_add(struct class *class, struct kobject *parent_kobj)
90     retval = kobject_add(&dir->kobj, parent_kobj, "%s", class->name);
91     if (retval < 0) {
92     kobject_put(&dir->kobj);
93     - return NULL;
94     + return ERR_PTR(retval);
95     }
96     return &dir->kobj;
97     }
98     @@ -1076,6 +1076,10 @@ int device_add(struct device *dev)
99    
100     parent = get_device(dev->parent);
101     kobj = get_device_parent(dev, parent);
102     + if (IS_ERR(kobj)) {
103     + error = PTR_ERR(kobj);
104     + goto parent_error;
105     + }
106     if (kobj)
107     dev->kobj.parent = kobj;
108    
109     @@ -1174,6 +1178,7 @@ int device_add(struct device *dev)
110     kobject_del(&dev->kobj);
111     Error:
112     cleanup_glue_dir(dev, glue_dir);
113     +parent_error:
114     put_device(parent);
115     name_error:
116     kfree(dev->p);
117     @@ -1991,6 +1996,11 @@ int device_move(struct device *dev, struct device *new_parent,
118     device_pm_lock();
119     new_parent = get_device(new_parent);
120     new_parent_kobj = get_device_parent(dev, new_parent);
121     + if (IS_ERR(new_parent_kobj)) {
122     + error = PTR_ERR(new_parent_kobj);
123     + put_device(new_parent);
124     + goto out;
125     + }
126    
127     pr_debug("device: '%s': %s: moving to '%s'\n", dev_name(dev),
128     __func__, new_parent ? dev_name(new_parent) : "<NULL>");
129     diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
130     index 7523929becdc..af5eff6835a8 100644
131     --- a/drivers/cpufreq/cpufreq.c
132     +++ b/drivers/cpufreq/cpufreq.c
133     @@ -657,6 +657,8 @@ static ssize_t store_##file_name \
134     struct cpufreq_policy new_policy; \
135     \
136     memcpy(&new_policy, policy, sizeof(*policy)); \
137     + new_policy.min = policy->user_policy.min; \
138     + new_policy.max = policy->user_policy.max; \
139     \
140     ret = sscanf(buf, "%u", &new_policy.object); \
141     if (ret != 1) \
142     diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
143     index 20d647d2dd2c..00aafe032e58 100644
144     --- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c
145     +++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
146     @@ -202,8 +202,7 @@ static void ish_remove(struct pci_dev *pdev)
147     kfree(ishtp_dev);
148     }
149    
150     -#ifdef CONFIG_PM
151     -static struct device *ish_resume_device;
152     +static struct device __maybe_unused *ish_resume_device;
153    
154     /**
155     * ish_resume_handler() - Work function to complete resume
156     @@ -214,7 +213,7 @@ static struct device *ish_resume_device;
157     * in that case a simple resume message is enough, others we need
158     * a reset sequence.
159     */
160     -static void ish_resume_handler(struct work_struct *work)
161     +static void __maybe_unused ish_resume_handler(struct work_struct *work)
162     {
163     struct pci_dev *pdev = to_pci_dev(ish_resume_device);
164     struct ishtp_device *dev = pci_get_drvdata(pdev);
165     @@ -245,7 +244,7 @@ static void ish_resume_handler(struct work_struct *work)
166     *
167     * Return: 0 to the pm core
168     */
169     -static int ish_suspend(struct device *device)
170     +static int __maybe_unused ish_suspend(struct device *device)
171     {
172     struct pci_dev *pdev = to_pci_dev(device);
173     struct ishtp_device *dev = pci_get_drvdata(pdev);
174     @@ -271,7 +270,7 @@ static int ish_suspend(struct device *device)
175     return 0;
176     }
177    
178     -static DECLARE_WORK(resume_work, ish_resume_handler);
179     +static __maybe_unused DECLARE_WORK(resume_work, ish_resume_handler);
180     /**
181     * ish_resume() - ISH resume callback
182     * @device: device pointer
183     @@ -280,7 +279,7 @@ static DECLARE_WORK(resume_work, ish_resume_handler);
184     *
185     * Return: 0 to the pm core
186     */
187     -static int ish_resume(struct device *device)
188     +static int __maybe_unused ish_resume(struct device *device)
189     {
190     struct pci_dev *pdev = to_pci_dev(device);
191     struct ishtp_device *dev = pci_get_drvdata(pdev);
192     @@ -294,21 +293,14 @@ static int ish_resume(struct device *device)
193     return 0;
194     }
195    
196     -static const struct dev_pm_ops ish_pm_ops = {
197     - .suspend = ish_suspend,
198     - .resume = ish_resume,
199     -};
200     -#define ISHTP_ISH_PM_OPS (&ish_pm_ops)
201     -#else
202     -#define ISHTP_ISH_PM_OPS NULL
203     -#endif /* CONFIG_PM */
204     +static SIMPLE_DEV_PM_OPS(ish_pm_ops, ish_suspend, ish_resume);
205    
206     static struct pci_driver ish_driver = {
207     .name = KBUILD_MODNAME,
208     .id_table = ish_pci_tbl,
209     .probe = ish_probe,
210     .remove = ish_remove,
211     - .driver.pm = ISHTP_ISH_PM_OPS,
212     + .driver.pm = &ish_pm_ops,
213     };
214    
215     module_pci_driver(ish_driver);
216     diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
217     index 577e57cad1dc..473da3bf10c6 100644
218     --- a/drivers/net/bonding/bond_options.c
219     +++ b/drivers/net/bonding/bond_options.c
220     @@ -1114,6 +1114,7 @@ static int bond_option_primary_set(struct bonding *bond,
221     slave->dev->name);
222     rcu_assign_pointer(bond->primary_slave, slave);
223     strcpy(bond->params.primary, slave->dev->name);
224     + bond->force_primary = true;
225     bond_select_active_slave(bond);
226     goto out;
227     }
228     diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
229     index c26debc531ee..71525950c641 100644
230     --- a/drivers/net/dsa/b53/b53_common.c
231     +++ b/drivers/net/dsa/b53/b53_common.c
232     @@ -1515,6 +1515,18 @@ static const struct b53_chip_data b53_switch_chips[] = {
233     .cpu_port = B53_CPU_PORT_25,
234     .duplex_reg = B53_DUPLEX_STAT_FE,
235     },
236     + {
237     + .chip_id = BCM5389_DEVICE_ID,
238     + .dev_name = "BCM5389",
239     + .vlans = 4096,
240     + .enabled_ports = 0x1f,
241     + .arl_entries = 4,
242     + .cpu_port = B53_CPU_PORT,
243     + .vta_regs = B53_VTA_REGS,
244     + .duplex_reg = B53_DUPLEX_STAT_GE,
245     + .jumbo_pm_reg = B53_JUMBO_PORT_MASK,
246     + .jumbo_size_reg = B53_JUMBO_MAX_SIZE,
247     + },
248     {
249     .chip_id = BCM5395_DEVICE_ID,
250     .dev_name = "BCM5395",
251     @@ -1825,6 +1837,7 @@ int b53_switch_detect(struct b53_device *dev)
252     else
253     dev->chip_id = BCM5365_DEVICE_ID;
254     break;
255     + case BCM5389_DEVICE_ID:
256     case BCM5395_DEVICE_ID:
257     case BCM5397_DEVICE_ID:
258     case BCM5398_DEVICE_ID:
259     diff --git a/drivers/net/dsa/b53/b53_mdio.c b/drivers/net/dsa/b53/b53_mdio.c
260     index 477a16b5660a..6f47ff1a7952 100644
261     --- a/drivers/net/dsa/b53/b53_mdio.c
262     +++ b/drivers/net/dsa/b53/b53_mdio.c
263     @@ -285,6 +285,7 @@ static const struct b53_io_ops b53_mdio_ops = {
264     #define B53_BRCM_OUI_1 0x0143bc00
265     #define B53_BRCM_OUI_2 0x03625c00
266     #define B53_BRCM_OUI_3 0x00406000
267     +#define B53_BRCM_OUI_4 0x01410c00
268    
269     static int b53_mdio_probe(struct mdio_device *mdiodev)
270     {
271     @@ -311,7 +312,8 @@ static int b53_mdio_probe(struct mdio_device *mdiodev)
272     */
273     if ((phy_id & 0xfffffc00) != B53_BRCM_OUI_1 &&
274     (phy_id & 0xfffffc00) != B53_BRCM_OUI_2 &&
275     - (phy_id & 0xfffffc00) != B53_BRCM_OUI_3) {
276     + (phy_id & 0xfffffc00) != B53_BRCM_OUI_3 &&
277     + (phy_id & 0xfffffc00) != B53_BRCM_OUI_4) {
278     dev_err(&mdiodev->dev, "Unsupported device: 0x%08x\n", phy_id);
279     return -ENODEV;
280     }
281     @@ -360,6 +362,7 @@ static const struct of_device_id b53_of_match[] = {
282     { .compatible = "brcm,bcm53125" },
283     { .compatible = "brcm,bcm53128" },
284     { .compatible = "brcm,bcm5365" },
285     + { .compatible = "brcm,bcm5389" },
286     { .compatible = "brcm,bcm5395" },
287     { .compatible = "brcm,bcm5397" },
288     { .compatible = "brcm,bcm5398" },
289     diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h
290     index f192a673caba..68ab20baa631 100644
291     --- a/drivers/net/dsa/b53/b53_priv.h
292     +++ b/drivers/net/dsa/b53/b53_priv.h
293     @@ -47,6 +47,7 @@ struct b53_io_ops {
294     enum {
295     BCM5325_DEVICE_ID = 0x25,
296     BCM5365_DEVICE_ID = 0x65,
297     + BCM5389_DEVICE_ID = 0x89,
298     BCM5395_DEVICE_ID = 0x95,
299     BCM5397_DEVICE_ID = 0x97,
300     BCM5398_DEVICE_ID = 0x98,
301     diff --git a/drivers/net/ethernet/natsemi/sonic.c b/drivers/net/ethernet/natsemi/sonic.c
302     index 612c7a44b26c..23821540ab07 100644
303     --- a/drivers/net/ethernet/natsemi/sonic.c
304     +++ b/drivers/net/ethernet/natsemi/sonic.c
305     @@ -71,7 +71,7 @@ static int sonic_open(struct net_device *dev)
306     for (i = 0; i < SONIC_NUM_RRS; i++) {
307     dma_addr_t laddr = dma_map_single(lp->device, skb_put(lp->rx_skb[i], SONIC_RBSIZE),
308     SONIC_RBSIZE, DMA_FROM_DEVICE);
309     - if (!laddr) {
310     + if (dma_mapping_error(lp->device, laddr)) {
311     while(i > 0) { /* free any that were mapped successfully */
312     i--;
313     dma_unmap_single(lp->device, lp->rx_laddr[i], SONIC_RBSIZE, DMA_FROM_DEVICE);
314     diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
315     index 1d56c73574e8..85bc0ca61389 100644
316     --- a/drivers/net/usb/qmi_wwan.c
317     +++ b/drivers/net/usb/qmi_wwan.c
318     @@ -808,6 +808,7 @@ static const struct usb_device_id products[] = {
319     {QMI_FIXED_INTF(0x05c6, 0x920d, 5)},
320     {QMI_QUIRK_SET_DTR(0x05c6, 0x9625, 4)}, /* YUGA CLM920-NC5 */
321     {QMI_FIXED_INTF(0x0846, 0x68a2, 8)},
322     + {QMI_FIXED_INTF(0x0846, 0x68d3, 8)}, /* Netgear Aircard 779S */
323     {QMI_FIXED_INTF(0x12d1, 0x140c, 1)}, /* Huawei E173 */
324     {QMI_FIXED_INTF(0x12d1, 0x14ac, 1)}, /* Huawei E1820 */
325     {QMI_FIXED_INTF(0x1435, 0xd181, 3)}, /* Wistron NeWeb D18Q1 */
326     diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
327     index fe32de252e6b..e7b873018dca 100644
328     --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
329     +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
330     @@ -1509,14 +1509,13 @@ static void iwl_pcie_set_interrupt_capa(struct pci_dev *pdev,
331     struct iwl_trans *trans)
332     {
333     struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
334     - int max_irqs, num_irqs, i, ret, nr_online_cpus;
335     + int max_irqs, num_irqs, i, ret;
336     u16 pci_cmd;
337    
338     if (!trans->cfg->mq_rx_supported)
339     goto enable_msi;
340    
341     - nr_online_cpus = num_online_cpus();
342     - max_irqs = min_t(u32, nr_online_cpus + 2, IWL_MAX_RX_HW_QUEUES);
343     + max_irqs = min_t(u32, num_online_cpus() + 2, IWL_MAX_RX_HW_QUEUES);
344     for (i = 0; i < max_irqs; i++)
345     trans_pcie->msix_entries[i].entry = i;
346    
347     @@ -1542,16 +1541,17 @@ static void iwl_pcie_set_interrupt_capa(struct pci_dev *pdev,
348     * Two interrupts less: non rx causes shared with FBQ and RSS.
349     * More than two interrupts: we will use fewer RSS queues.
350     */
351     - if (num_irqs <= nr_online_cpus) {
352     + if (num_irqs <= max_irqs - 2) {
353     trans_pcie->trans->num_rx_queues = num_irqs + 1;
354     trans_pcie->shared_vec_mask = IWL_SHARED_IRQ_NON_RX |
355     IWL_SHARED_IRQ_FIRST_RSS;
356     - } else if (num_irqs == nr_online_cpus + 1) {
357     + } else if (num_irqs == max_irqs - 1) {
358     trans_pcie->trans->num_rx_queues = num_irqs;
359     trans_pcie->shared_vec_mask = IWL_SHARED_IRQ_NON_RX;
360     } else {
361     trans_pcie->trans->num_rx_queues = num_irqs - 1;
362     }
363     + WARN_ON(trans_pcie->trans->num_rx_queues > IWL_MAX_RX_HW_QUEUES);
364    
365     trans_pcie->alloc_vecs = num_irqs;
366     trans_pcie->msix_enabled = true;
367     diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
368     index 8a1bfd489c26..ed277685da1d 100644
369     --- a/drivers/platform/x86/asus-wmi.c
370     +++ b/drivers/platform/x86/asus-wmi.c
371     @@ -161,6 +161,16 @@ MODULE_LICENSE("GPL");
372    
373     static const char * const ashs_ids[] = { "ATK4001", "ATK4002", NULL };
374    
375     +static bool ashs_present(void)
376     +{
377     + int i = 0;
378     + while (ashs_ids[i]) {
379     + if (acpi_dev_found(ashs_ids[i++]))
380     + return true;
381     + }
382     + return false;
383     +}
384     +
385     struct bios_args {
386     u32 arg0;
387     u32 arg1;
388     @@ -966,6 +976,9 @@ static int asus_new_rfkill(struct asus_wmi *asus,
389    
390     static void asus_wmi_rfkill_exit(struct asus_wmi *asus)
391     {
392     + if (asus->driver->wlan_ctrl_by_user && ashs_present())
393     + return;
394     +
395     asus_unregister_rfkill_notifier(asus, "\\_SB.PCI0.P0P5");
396     asus_unregister_rfkill_notifier(asus, "\\_SB.PCI0.P0P6");
397     asus_unregister_rfkill_notifier(asus, "\\_SB.PCI0.P0P7");
398     @@ -2062,16 +2075,6 @@ static int asus_wmi_fan_init(struct asus_wmi *asus)
399     return 0;
400     }
401    
402     -static bool ashs_present(void)
403     -{
404     - int i = 0;
405     - while (ashs_ids[i]) {
406     - if (acpi_dev_found(ashs_ids[i++]))
407     - return true;
408     - }
409     - return false;
410     -}
411     -
412     /*
413     * WMI Driver
414     */
415     diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
416     index e2bc91585b4f..19b5f08cb423 100644
417     --- a/drivers/usb/musb/musb_host.c
418     +++ b/drivers/usb/musb/musb_host.c
419     @@ -2554,8 +2554,11 @@ static int musb_bus_suspend(struct usb_hcd *hcd)
420     {
421     struct musb *musb = hcd_to_musb(hcd);
422     u8 devctl;
423     + int ret;
424    
425     - musb_port_suspend(musb, true);
426     + ret = musb_port_suspend(musb, true);
427     + if (ret)
428     + return ret;
429    
430     if (!is_host_active(musb))
431     return 0;
432     diff --git a/drivers/usb/musb/musb_host.h b/drivers/usb/musb/musb_host.h
433     index 7bbf01bf4bb0..54d02ed032df 100644
434     --- a/drivers/usb/musb/musb_host.h
435     +++ b/drivers/usb/musb/musb_host.h
436     @@ -92,7 +92,7 @@ extern void musb_host_rx(struct musb *, u8);
437     extern void musb_root_disconnect(struct musb *musb);
438     extern void musb_host_resume_root_hub(struct musb *musb);
439     extern void musb_host_poke_root_hub(struct musb *musb);
440     -extern void musb_port_suspend(struct musb *musb, bool do_suspend);
441     +extern int musb_port_suspend(struct musb *musb, bool do_suspend);
442     extern void musb_port_reset(struct musb *musb, bool do_reset);
443     extern void musb_host_finish_resume(struct work_struct *work);
444     #else
445     @@ -124,7 +124,10 @@ static inline void musb_root_disconnect(struct musb *musb) {}
446     static inline void musb_host_resume_root_hub(struct musb *musb) {}
447     static inline void musb_host_poll_rh_status(struct musb *musb) {}
448     static inline void musb_host_poke_root_hub(struct musb *musb) {}
449     -static inline void musb_port_suspend(struct musb *musb, bool do_suspend) {}
450     +static inline int musb_port_suspend(struct musb *musb, bool do_suspend)
451     +{
452     + return 0;
453     +}
454     static inline void musb_port_reset(struct musb *musb, bool do_reset) {}
455     static inline void musb_host_finish_resume(struct work_struct *work) {}
456     #endif
457     diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c
458     index 61b5f1c3c5bc..71678a487be2 100644
459     --- a/drivers/usb/musb/musb_virthub.c
460     +++ b/drivers/usb/musb/musb_virthub.c
461     @@ -73,14 +73,14 @@ void musb_host_finish_resume(struct work_struct *work)
462     spin_unlock_irqrestore(&musb->lock, flags);
463     }
464    
465     -void musb_port_suspend(struct musb *musb, bool do_suspend)
466     +int musb_port_suspend(struct musb *musb, bool do_suspend)
467     {
468     struct usb_otg *otg = musb->xceiv->otg;
469     u8 power;
470     void __iomem *mbase = musb->mregs;
471    
472     if (!is_host_active(musb))
473     - return;
474     + return 0;
475    
476     /* NOTE: this doesn't necessarily put PHY into low power mode,
477     * turning off its clock; that's a function of PHY integration and
478     @@ -91,16 +91,20 @@ void musb_port_suspend(struct musb *musb, bool do_suspend)
479     if (do_suspend) {
480     int retries = 10000;
481    
482     - power &= ~MUSB_POWER_RESUME;
483     - power |= MUSB_POWER_SUSPENDM;
484     - musb_writeb(mbase, MUSB_POWER, power);
485     + if (power & MUSB_POWER_RESUME)
486     + return -EBUSY;
487    
488     - /* Needed for OPT A tests */
489     - power = musb_readb(mbase, MUSB_POWER);
490     - while (power & MUSB_POWER_SUSPENDM) {
491     + if (!(power & MUSB_POWER_SUSPENDM)) {
492     + power |= MUSB_POWER_SUSPENDM;
493     + musb_writeb(mbase, MUSB_POWER, power);
494     +
495     + /* Needed for OPT A tests */
496     power = musb_readb(mbase, MUSB_POWER);
497     - if (retries-- < 1)
498     - break;
499     + while (power & MUSB_POWER_SUSPENDM) {
500     + power = musb_readb(mbase, MUSB_POWER);
501     + if (retries-- < 1)
502     + break;
503     + }
504     }
505    
506     musb_dbg(musb, "Root port suspended, power %02x", power);
507     @@ -137,6 +141,7 @@ void musb_port_suspend(struct musb *musb, bool do_suspend)
508     schedule_delayed_work(&musb->finish_resume_work,
509     msecs_to_jiffies(USB_RESUME_TIMEOUT));
510     }
511     + return 0;
512     }
513    
514     void musb_port_reset(struct musb *musb, bool do_reset)
515     diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
516     index c81bc4efe1a6..8b6489ae74eb 100644
517     --- a/drivers/vhost/vhost.c
518     +++ b/drivers/vhost/vhost.c
519     @@ -2295,6 +2295,9 @@ struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type)
520     struct vhost_msg_node *node = kmalloc(sizeof *node, GFP_KERNEL);
521     if (!node)
522     return NULL;
523     +
524     + /* Make sure all padding within the structure is initialized. */
525     + memset(&node->msg, 0, sizeof node->msg);
526     node->vq = vq;
527     node->msg.type = type;
528     return node;
529     diff --git a/drivers/w1/masters/mxc_w1.c b/drivers/w1/masters/mxc_w1.c
530     index a4621757a47f..dacb5919970c 100644
531     --- a/drivers/w1/masters/mxc_w1.c
532     +++ b/drivers/w1/masters/mxc_w1.c
533     @@ -113,6 +113,10 @@ static int mxc_w1_probe(struct platform_device *pdev)
534     if (IS_ERR(mdev->clk))
535     return PTR_ERR(mdev->clk);
536    
537     + err = clk_prepare_enable(mdev->clk);
538     + if (err)
539     + return err;
540     +
541     clkrate = clk_get_rate(mdev->clk);
542     if (clkrate < 10000000)
543     dev_warn(&pdev->dev,
544     @@ -126,12 +130,10 @@ static int mxc_w1_probe(struct platform_device *pdev)
545    
546     res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
547     mdev->regs = devm_ioremap_resource(&pdev->dev, res);
548     - if (IS_ERR(mdev->regs))
549     - return PTR_ERR(mdev->regs);
550     -
551     - err = clk_prepare_enable(mdev->clk);
552     - if (err)
553     - return err;
554     + if (IS_ERR(mdev->regs)) {
555     + err = PTR_ERR(mdev->regs);
556     + goto out_disable_clk;
557     + }
558    
559     /* Software reset 1-Wire module */
560     writeb(MXC_W1_RESET_RST, mdev->regs + MXC_W1_RESET);
561     @@ -147,8 +149,12 @@ static int mxc_w1_probe(struct platform_device *pdev)
562    
563     err = w1_add_master_device(&mdev->bus_master);
564     if (err)
565     - clk_disable_unprepare(mdev->clk);
566     + goto out_disable_clk;
567    
568     + return 0;
569     +
570     +out_disable_clk:
571     + clk_disable_unprepare(mdev->clk);
572     return err;
573     }
574    
575     diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
576     index 9b4688ab1d8e..f842261ce973 100644
577     --- a/fs/binfmt_misc.c
578     +++ b/fs/binfmt_misc.c
579     @@ -384,8 +384,13 @@ static Node *create_entry(const char __user *buffer, size_t count)
580     s = strchr(p, del);
581     if (!s)
582     goto einval;
583     - *s++ = '\0';
584     - e->offset = simple_strtoul(p, &p, 10);
585     + *s = '\0';
586     + if (p != s) {
587     + int r = kstrtoint(p, 10, &e->offset);
588     + if (r != 0 || e->offset < 0)
589     + goto einval;
590     + }
591     + p = s;
592     if (*p++)
593     goto einval;
594     pr_debug("register: offset: %#x\n", e->offset);
595     @@ -425,7 +430,8 @@ static Node *create_entry(const char __user *buffer, size_t count)
596     if (e->mask &&
597     string_unescape_inplace(e->mask, UNESCAPE_HEX) != e->size)
598     goto einval;
599     - if (e->size + e->offset > BINPRM_BUF_SIZE)
600     + if (e->size > BINPRM_BUF_SIZE ||
601     + BINPRM_BUF_SIZE - e->size < e->offset)
602     goto einval;
603     pr_debug("register: magic/mask length: %i\n", e->size);
604     if (USE_DEBUG) {
605     diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
606     index d3dd631432eb..cbf512b64597 100644
607     --- a/fs/btrfs/ioctl.c
608     +++ b/fs/btrfs/ioctl.c
609     @@ -2708,8 +2708,10 @@ static long btrfs_ioctl_rm_dev_v2(struct file *file, void __user *arg)
610     }
611    
612     /* Check for compatibility reject unknown flags */
613     - if (vol_args->flags & ~BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED)
614     - return -EOPNOTSUPP;
615     + if (vol_args->flags & ~BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED) {
616     + ret = -EOPNOTSUPP;
617     + goto out;
618     + }
619    
620     if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running,
621     1)) {
622     @@ -3887,11 +3889,6 @@ static noinline int btrfs_clone_files(struct file *file, struct file *file_src,
623     src->i_sb != inode->i_sb)
624     return -EXDEV;
625    
626     - /* don't make the dst file partly checksummed */
627     - if ((BTRFS_I(src)->flags & BTRFS_INODE_NODATASUM) !=
628     - (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM))
629     - return -EINVAL;
630     -
631     if (S_ISDIR(src->i_mode) || S_ISDIR(inode->i_mode))
632     return -EISDIR;
633    
634     @@ -3901,6 +3898,13 @@ static noinline int btrfs_clone_files(struct file *file, struct file *file_src,
635     inode_lock(src);
636     }
637    
638     + /* don't make the dst file partly checksummed */
639     + if ((BTRFS_I(src)->flags & BTRFS_INODE_NODATASUM) !=
640     + (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM)) {
641     + ret = -EINVAL;
642     + goto out_unlock;
643     + }
644     +
645     /* determine range to clone */
646     ret = -EINVAL;
647     if (off + len > src->i_size || off + len < off)
648     diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
649     index fffb9ab8526e..16c0585cd81c 100644
650     --- a/fs/btrfs/scrub.c
651     +++ b/fs/btrfs/scrub.c
652     @@ -2519,7 +2519,7 @@ static int scrub_extent(struct scrub_ctx *sctx, u64 logical, u64 len,
653     have_csum = scrub_find_csum(sctx, logical, csum);
654     if (have_csum == 0)
655     ++sctx->stat.no_csum;
656     - if (sctx->is_dev_replace && !have_csum) {
657     + if (0 && sctx->is_dev_replace && !have_csum) {
658     ret = copy_nocow_pages(sctx, logical, l,
659     mirror_num,
660     physical_for_dev_replace);
661     diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
662     index 44b7ccbe4b08..e0214334769b 100644
663     --- a/fs/cifs/smb2pdu.c
664     +++ b/fs/cifs/smb2pdu.c
665     @@ -1004,6 +1004,7 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
666     sess_data->ses = ses;
667     sess_data->buf0_type = CIFS_NO_BUFFER;
668     sess_data->nls_cp = (struct nls_table *) nls_cp;
669     + sess_data->previous_session = ses->Suid;
670    
671     while (sess_data->func)
672     sess_data->func(sess_data);
673     diff --git a/fs/ext4/indirect.c b/fs/ext4/indirect.c
674     index bc15c2c17633..58229c1b4a3d 100644
675     --- a/fs/ext4/indirect.c
676     +++ b/fs/ext4/indirect.c
677     @@ -560,10 +560,16 @@ int ext4_ind_map_blocks(handle_t *handle, struct inode *inode,
678     unsigned epb = inode->i_sb->s_blocksize / sizeof(u32);
679     int i;
680    
681     - /* Count number blocks in a subtree under 'partial' */
682     - count = 1;
683     - for (i = 0; partial + i != chain + depth - 1; i++)
684     - count *= epb;
685     + /*
686     + * Count number blocks in a subtree under 'partial'. At each
687     + * level we count number of complete empty subtrees beyond
688     + * current offset and then descend into the subtree only
689     + * partially beyond current offset.
690     + */
691     + count = 0;
692     + for (i = partial - chain + 1; i < depth; i++)
693     + count = count * epb + (epb - offsets[i] - 1);
694     + count++;
695     /* Fill in size of a hole we found */
696     map->m_pblk = 0;
697     map->m_len = min_t(unsigned int, map->m_len, count);
698     diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
699     index 340428274532..7c025ee1276f 100644
700     --- a/fs/ext4/inode.c
701     +++ b/fs/ext4/inode.c
702     @@ -4038,28 +4038,28 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
703     EXT4_BLOCK_SIZE_BITS(sb);
704     stop_block = (offset + length) >> EXT4_BLOCK_SIZE_BITS(sb);
705    
706     - /* If there are no blocks to remove, return now */
707     - if (first_block >= stop_block)
708     - goto out_stop;
709     + /* If there are blocks to remove, do it */
710     + if (stop_block > first_block) {
711    
712     - down_write(&EXT4_I(inode)->i_data_sem);
713     - ext4_discard_preallocations(inode);
714     + down_write(&EXT4_I(inode)->i_data_sem);
715     + ext4_discard_preallocations(inode);
716    
717     - ret = ext4_es_remove_extent(inode, first_block,
718     - stop_block - first_block);
719     - if (ret) {
720     - up_write(&EXT4_I(inode)->i_data_sem);
721     - goto out_stop;
722     - }
723     + ret = ext4_es_remove_extent(inode, first_block,
724     + stop_block - first_block);
725     + if (ret) {
726     + up_write(&EXT4_I(inode)->i_data_sem);
727     + goto out_stop;
728     + }
729    
730     - if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))
731     - ret = ext4_ext_remove_space(inode, first_block,
732     - stop_block - 1);
733     - else
734     - ret = ext4_ind_remove_space(handle, inode, first_block,
735     - stop_block);
736     + if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))
737     + ret = ext4_ext_remove_space(inode, first_block,
738     + stop_block - 1);
739     + else
740     + ret = ext4_ind_remove_space(handle, inode, first_block,
741     + stop_block);
742    
743     - up_write(&EXT4_I(inode)->i_data_sem);
744     + up_write(&EXT4_I(inode)->i_data_sem);
745     + }
746     if (IS_SYNC(inode))
747     ext4_handle_sync(handle);
748    
749     diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
750     index 95bf46654153..eb720d9e2953 100644
751     --- a/fs/ext4/resize.c
752     +++ b/fs/ext4/resize.c
753     @@ -1903,7 +1903,7 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
754     return 0;
755    
756     n_group = ext4_get_group_number(sb, n_blocks_count - 1);
757     - if (n_group > (0xFFFFFFFFUL / EXT4_INODES_PER_GROUP(sb))) {
758     + if (n_group >= (0xFFFFFFFFUL / EXT4_INODES_PER_GROUP(sb))) {
759     ext4_warning(sb, "resize would cause inodes_count overflow");
760     return -EINVAL;
761     }
762     diff --git a/fs/orangefs/namei.c b/fs/orangefs/namei.c
763     index 561497a7a247..5fe458628e00 100644
764     --- a/fs/orangefs/namei.c
765     +++ b/fs/orangefs/namei.c
766     @@ -312,6 +312,13 @@ static int orangefs_symlink(struct inode *dir,
767     ret = PTR_ERR(inode);
768     goto out;
769     }
770     + /*
771     + * This is necessary because orangefs_inode_getattr will not
772     + * re-read symlink size as it is impossible for it to change.
773     + * Invalidating the cache does not help. orangefs_new_inode
774     + * does not set the correct size (it does not know symname).
775     + */
776     + inode->i_size = strlen(symname);
777    
778     gossip_debug(GOSSIP_NAME_DEBUG,
779     "Assigned symlink inode new number of %pU\n",
780     diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
781     index 0a9222ef904c..da3d373eb5bd 100644
782     --- a/net/bridge/netfilter/ebtables.c
783     +++ b/net/bridge/netfilter/ebtables.c
784     @@ -1923,7 +1923,8 @@ static int compat_mtw_from_user(struct compat_ebt_entry_mwt *mwt,
785     int off, pad = 0;
786     unsigned int size_kern, match_size = mwt->match_size;
787    
788     - strlcpy(name, mwt->u.name, sizeof(name));
789     + if (strscpy(name, mwt->u.name, sizeof(name)) < 0)
790     + return -EINVAL;
791    
792     if (state->buf_kern_start)
793     dst = state->buf_kern_start + state->buf_kern_offset;
794     diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
795     index 94a55b83e48c..8999e25fd0e1 100644
796     --- a/net/ipv4/tcp_input.c
797     +++ b/net/ipv4/tcp_input.c
798     @@ -636,7 +636,7 @@ void tcp_rcv_space_adjust(struct sock *sk)
799     sk->sk_rcvbuf = rcvbuf;
800    
801     /* Make the window clamp follow along. */
802     - tp->window_clamp = rcvwin;
803     + tp->window_clamp = tcp_win_from_space(rcvbuf);
804     }
805     }
806     tp->rcvq_space.space = copied;
807     diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
808     index b3960738464e..504cdae41013 100644
809     --- a/net/ipv4/tcp_ipv4.c
810     +++ b/net/ipv4/tcp_ipv4.c
811     @@ -1661,6 +1661,10 @@ int tcp_v4_rcv(struct sk_buff *skb)
812     reqsk_put(req);
813     goto discard_it;
814     }
815     + if (tcp_checksum_complete(skb)) {
816     + reqsk_put(req);
817     + goto csum_error;
818     + }
819     if (unlikely(sk->sk_state != TCP_LISTEN)) {
820     inet_csk_reqsk_queue_drop_and_put(sk, req);
821     goto lookup;
822     diff --git a/net/ipv6/route.c b/net/ipv6/route.c
823     index f6ac472acd0f..70fa31e37360 100644
824     --- a/net/ipv6/route.c
825     +++ b/net/ipv6/route.c
826     @@ -1373,9 +1373,6 @@ static void __ip6_rt_update_pmtu(struct dst_entry *dst, const struct sock *sk,
827     {
828     struct rt6_info *rt6 = (struct rt6_info *)dst;
829    
830     - if (rt6->rt6i_flags & RTF_LOCAL)
831     - return;
832     -
833     if (dst_metric_locked(dst, RTAX_MTU))
834     return;
835    
836     diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
837     index eb624547382f..0a69d39880f2 100644
838     --- a/net/ipv6/tcp_ipv6.c
839     +++ b/net/ipv6/tcp_ipv6.c
840     @@ -1433,6 +1433,10 @@ static int tcp_v6_rcv(struct sk_buff *skb)
841     reqsk_put(req);
842     goto discard_it;
843     }
844     + if (tcp_checksum_complete(skb)) {
845     + reqsk_put(req);
846     + goto csum_error;
847     + }
848     if (unlikely(sk->sk_state != TCP_LISTEN)) {
849     inet_csk_reqsk_queue_drop_and_put(sk, req);
850     goto lookup;
851     diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
852     index e0f71c01d728..0c7f27a1725f 100644
853     --- a/net/ipv6/xfrm6_policy.c
854     +++ b/net/ipv6/xfrm6_policy.c
855     @@ -121,7 +121,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
856     struct flowi6 *fl6 = &fl->u.ip6;
857     int onlyproto = 0;
858     const struct ipv6hdr *hdr = ipv6_hdr(skb);
859     - u16 offset = sizeof(*hdr);
860     + u32 offset = sizeof(*hdr);
861     struct ipv6_opt_hdr *exthdr;
862     const unsigned char *nh = skb_network_header(skb);
863     u16 nhoff = IP6CB(skb)->nhoff;
864     diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
865     index c5f2350a2b50..079b3c426720 100644
866     --- a/net/netfilter/ipvs/ip_vs_ctl.c
867     +++ b/net/netfilter/ipvs/ip_vs_ctl.c
868     @@ -2390,8 +2390,10 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
869     struct ipvs_sync_daemon_cfg cfg;
870    
871     memset(&cfg, 0, sizeof(cfg));
872     - strlcpy(cfg.mcast_ifn, dm->mcast_ifn,
873     - sizeof(cfg.mcast_ifn));
874     + ret = -EINVAL;
875     + if (strscpy(cfg.mcast_ifn, dm->mcast_ifn,
876     + sizeof(cfg.mcast_ifn)) <= 0)
877     + goto out_dec;
878     cfg.syncid = dm->syncid;
879     ret = start_sync_thread(ipvs, &cfg, dm->state);
880     } else {
881     @@ -2429,12 +2431,19 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
882     }
883     }
884    
885     + if ((cmd == IP_VS_SO_SET_ADD || cmd == IP_VS_SO_SET_EDIT) &&
886     + strnlen(usvc.sched_name, IP_VS_SCHEDNAME_MAXLEN) ==
887     + IP_VS_SCHEDNAME_MAXLEN) {
888     + ret = -EINVAL;
889     + goto out_unlock;
890     + }
891     +
892     /* Check for valid protocol: TCP or UDP or SCTP, even for fwmark!=0 */
893     if (usvc.protocol != IPPROTO_TCP && usvc.protocol != IPPROTO_UDP &&
894     usvc.protocol != IPPROTO_SCTP) {
895     - pr_err("set_ctl: invalid protocol: %d %pI4:%d %s\n",
896     + pr_err("set_ctl: invalid protocol: %d %pI4:%d\n",
897     usvc.protocol, &usvc.addr.ip,
898     - ntohs(usvc.port), usvc.sched_name);
899     + ntohs(usvc.port));
900     ret = -EFAULT;
901     goto out_unlock;
902     }
903     @@ -2863,7 +2872,7 @@ static const struct nla_policy ip_vs_cmd_policy[IPVS_CMD_ATTR_MAX + 1] = {
904     static const struct nla_policy ip_vs_daemon_policy[IPVS_DAEMON_ATTR_MAX + 1] = {
905     [IPVS_DAEMON_ATTR_STATE] = { .type = NLA_U32 },
906     [IPVS_DAEMON_ATTR_MCAST_IFN] = { .type = NLA_NUL_STRING,
907     - .len = IP_VS_IFNAME_MAXLEN },
908     + .len = IP_VS_IFNAME_MAXLEN - 1 },
909     [IPVS_DAEMON_ATTR_SYNC_ID] = { .type = NLA_U32 },
910     [IPVS_DAEMON_ATTR_SYNC_MAXLEN] = { .type = NLA_U16 },
911     [IPVS_DAEMON_ATTR_MCAST_GROUP] = { .type = NLA_U32 },
912     @@ -2881,7 +2890,7 @@ static const struct nla_policy ip_vs_svc_policy[IPVS_SVC_ATTR_MAX + 1] = {
913     [IPVS_SVC_ATTR_PORT] = { .type = NLA_U16 },
914     [IPVS_SVC_ATTR_FWMARK] = { .type = NLA_U32 },
915     [IPVS_SVC_ATTR_SCHED_NAME] = { .type = NLA_NUL_STRING,
916     - .len = IP_VS_SCHEDNAME_MAXLEN },
917     + .len = IP_VS_SCHEDNAME_MAXLEN - 1 },
918     [IPVS_SVC_ATTR_PE_NAME] = { .type = NLA_NUL_STRING,
919     .len = IP_VS_PENAME_MAXLEN },
920     [IPVS_SVC_ATTR_FLAGS] = { .type = NLA_BINARY,
921     diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c
922     index 289af6f9bb3b..8b2e87e4493e 100644
923     --- a/net/sched/act_simple.c
924     +++ b/net/sched/act_simple.c
925     @@ -55,22 +55,22 @@ static void tcf_simp_release(struct tc_action *a, int bind)
926     kfree(d->tcfd_defdata);
927     }
928    
929     -static int alloc_defdata(struct tcf_defact *d, char *defdata)
930     +static int alloc_defdata(struct tcf_defact *d, const struct nlattr *defdata)
931     {
932     d->tcfd_defdata = kzalloc(SIMP_MAX_DATA, GFP_KERNEL);
933     if (unlikely(!d->tcfd_defdata))
934     return -ENOMEM;
935     - strlcpy(d->tcfd_defdata, defdata, SIMP_MAX_DATA);
936     + nla_strlcpy(d->tcfd_defdata, defdata, SIMP_MAX_DATA);
937     return 0;
938     }
939    
940     -static void reset_policy(struct tcf_defact *d, char *defdata,
941     +static void reset_policy(struct tcf_defact *d, const struct nlattr *defdata,
942     struct tc_defact *p)
943     {
944     spin_lock_bh(&d->tcf_lock);
945     d->tcf_action = p->action;
946     memset(d->tcfd_defdata, 0, SIMP_MAX_DATA);
947     - strlcpy(d->tcfd_defdata, defdata, SIMP_MAX_DATA);
948     + nla_strlcpy(d->tcfd_defdata, defdata, SIMP_MAX_DATA);
949     spin_unlock_bh(&d->tcf_lock);
950     }
951    
952     @@ -89,7 +89,6 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
953     struct tcf_defact *d;
954     bool exists = false;
955     int ret = 0, err;
956     - char *defdata;
957    
958     if (nla == NULL)
959     return -EINVAL;
960     @@ -112,8 +111,6 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
961     return -EINVAL;
962     }
963    
964     - defdata = nla_data(tb[TCA_DEF_DATA]);
965     -
966     if (!exists) {
967     ret = tcf_hash_create(tn, parm->index, est, a,
968     &act_simp_ops, bind, false);
969     @@ -121,7 +118,7 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
970     return ret;
971    
972     d = to_defact(*a);
973     - ret = alloc_defdata(d, defdata);
974     + ret = alloc_defdata(d, tb[TCA_DEF_DATA]);
975     if (ret < 0) {
976     tcf_hash_cleanup(*a, est);
977     return ret;
978     @@ -135,7 +132,7 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
979     if (!ovr)
980     return -EEXIST;
981    
982     - reset_policy(d, defdata, parm);
983     + reset_policy(d, tb[TCA_DEF_DATA], parm);
984     }
985    
986     if (ret == ACT_P_CREATED)
987     diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c
988     index 0af1132a869e..56af7308a2fd 100644
989     --- a/sound/pci/hda/hda_controller.c
990     +++ b/sound/pci/hda/hda_controller.c
991     @@ -748,8 +748,10 @@ int snd_hda_attach_pcm_stream(struct hda_bus *_bus, struct hda_codec *codec,
992     return err;
993     strlcpy(pcm->name, cpcm->name, sizeof(pcm->name));
994     apcm = kzalloc(sizeof(*apcm), GFP_KERNEL);
995     - if (apcm == NULL)
996     + if (apcm == NULL) {
997     + snd_device_free(chip->card, pcm);
998     return -ENOMEM;
999     + }
1000     apcm->chip = chip;
1001     apcm->pcm = pcm;
1002     apcm->codec = codec;
1003     diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
1004     index b3851b991120..6b5804e063a3 100644
1005     --- a/sound/pci/hda/patch_conexant.c
1006     +++ b/sound/pci/hda/patch_conexant.c
1007     @@ -851,6 +851,8 @@ static const struct snd_pci_quirk cxt5066_fixups[] = {
1008     SND_PCI_QUIRK(0x103c, 0x8079, "HP EliteBook 840 G3", CXT_FIXUP_HP_DOCK),
1009     SND_PCI_QUIRK(0x103c, 0x807C, "HP EliteBook 820 G3", CXT_FIXUP_HP_DOCK),
1010     SND_PCI_QUIRK(0x103c, 0x80FD, "HP ProBook 640 G2", CXT_FIXUP_HP_DOCK),
1011     + SND_PCI_QUIRK(0x103c, 0x83b3, "HP EliteBook 830 G5", CXT_FIXUP_HP_DOCK),
1012     + SND_PCI_QUIRK(0x103c, 0x83d3, "HP ProBook 640 G4", CXT_FIXUP_HP_DOCK),
1013     SND_PCI_QUIRK(0x103c, 0x8174, "HP Spectre x360", CXT_FIXUP_HP_SPECTRE),
1014     SND_PCI_QUIRK(0x103c, 0x8115, "HP Z1 Gen3", CXT_FIXUP_HP_GATE_MIC),
1015     SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN),
1016     diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1017     index 39cd35f6a6df..183436e4a8c1 100644
1018     --- a/sound/pci/hda/patch_realtek.c
1019     +++ b/sound/pci/hda/patch_realtek.c
1020     @@ -333,6 +333,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec)
1021     case 0x10ec0236:
1022     case 0x10ec0255:
1023     case 0x10ec0256:
1024     + case 0x10ec0257:
1025     case 0x10ec0282:
1026     case 0x10ec0283:
1027     case 0x10ec0286:
1028     @@ -2663,6 +2664,7 @@ enum {
1029     ALC269_TYPE_ALC298,
1030     ALC269_TYPE_ALC255,
1031     ALC269_TYPE_ALC256,
1032     + ALC269_TYPE_ALC257,
1033     ALC269_TYPE_ALC225,
1034     ALC269_TYPE_ALC294,
1035     ALC269_TYPE_ALC700,
1036     @@ -2695,6 +2697,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
1037     case ALC269_TYPE_ALC298:
1038     case ALC269_TYPE_ALC255:
1039     case ALC269_TYPE_ALC256:
1040     + case ALC269_TYPE_ALC257:
1041     case ALC269_TYPE_ALC225:
1042     case ALC269_TYPE_ALC294:
1043     case ALC269_TYPE_ALC700:
1044     @@ -6375,6 +6378,10 @@ static int patch_alc269(struct hda_codec *codec)
1045     spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
1046     alc_update_coef_idx(codec, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/
1047     break;
1048     + case 0x10ec0257:
1049     + spec->codec_variant = ALC269_TYPE_ALC257;
1050     + spec->gen.mixer_nid = 0;
1051     + break;
1052     case 0x10ec0225:
1053     case 0x10ec0295:
1054     case 0x10ec0299:
1055     @@ -7361,6 +7368,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = {
1056     HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
1057     HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
1058     HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
1059     + HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
1060     HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
1061     HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
1062     HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
1063     diff --git a/tools/objtool/.gitignore b/tools/objtool/.gitignore
1064     index d3102c865a95..914cff12899b 100644
1065     --- a/tools/objtool/.gitignore
1066     +++ b/tools/objtool/.gitignore
1067     @@ -1,3 +1,3 @@
1068     -arch/x86/insn/inat-tables.c
1069     +arch/x86/lib/inat-tables.c
1070     objtool
1071     fixdep