Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.14 commit in: /
Date: Wed, 29 Dec 2021 13:12:12
Message-Id: 1640783514.8a47163889c90544a970b7e2c947fc5bef899c91.mpagano@gentoo
1 commit: 8a47163889c90544a970b7e2c947fc5bef899c91
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 29 13:11:54 2021 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 29 13:11:54 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=8a471638
7
8 Linux patch 4.14.260
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1259_linux-4.14.260.patch | 687 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 691 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index db2d1b6c..a35bbc39 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -1083,6 +1083,10 @@ Patch: 1258_linux-4.14.259.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.14.259
23
24 +Patch: 1259_linux-4.14.260.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.14.260
27 +
28 Patch: 1500_XATTR_USER_PREFIX.patch
29 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
30 Desc: Support for namespace user.pax.* on tmpfs.
31
32 diff --git a/1259_linux-4.14.260.patch b/1259_linux-4.14.260.patch
33 new file mode 100644
34 index 00000000..fdec1014
35 --- /dev/null
36 +++ b/1259_linux-4.14.260.patch
37 @@ -0,0 +1,687 @@
38 +diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
39 +index 6de214080bbfa..d840466c8b216 100644
40 +--- a/Documentation/admin-guide/kernel-parameters.txt
41 ++++ b/Documentation/admin-guide/kernel-parameters.txt
42 +@@ -1905,8 +1905,12 @@
43 + Default is 1 (enabled)
44 +
45 + kvm-intel.emulate_invalid_guest_state=
46 +- [KVM,Intel] Enable emulation of invalid guest states
47 +- Default is 0 (disabled)
48 ++ [KVM,Intel] Disable emulation of invalid guest state.
49 ++ Ignored if kvm-intel.enable_unrestricted_guest=1, as
50 ++ guest state is never invalid for unrestricted guests.
51 ++ This param doesn't apply to nested guests (L2), as KVM
52 ++ never emulates invalid L2 guest state.
53 ++ Default is 1 (enabled)
54 +
55 + kvm-intel.flexpriority=
56 + [KVM,Intel] Disable FlexPriority feature (TPR shadow).
57 +diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
58 +index 9ba04c0bab8db..f5d78c8005341 100644
59 +--- a/Documentation/networking/bonding.txt
60 ++++ b/Documentation/networking/bonding.txt
61 +@@ -191,11 +191,12 @@ ad_actor_sys_prio
62 + ad_actor_system
63 +
64 + In an AD system, this specifies the mac-address for the actor in
65 +- protocol packet exchanges (LACPDUs). The value cannot be NULL or
66 +- multicast. It is preferred to have the local-admin bit set for this
67 +- mac but driver does not enforce it. If the value is not given then
68 +- system defaults to using the masters' mac address as actors' system
69 +- address.
70 ++ protocol packet exchanges (LACPDUs). The value cannot be a multicast
71 ++ address. If the all-zeroes MAC is specified, bonding will internally
72 ++ use the MAC of the bond itself. It is preferred to have the
73 ++ local-admin bit set for this mac but driver does not enforce it. If
74 ++ the value is not given then system defaults to using the masters'
75 ++ mac address as actors' system address.
76 +
77 + This parameter has effect only in 802.3ad mode and is available through
78 + SysFs interface.
79 +diff --git a/Makefile b/Makefile
80 +index 1d22e50da86e8..8a87f5c06a830 100644
81 +--- a/Makefile
82 ++++ b/Makefile
83 +@@ -1,7 +1,7 @@
84 + # SPDX-License-Identifier: GPL-2.0
85 + VERSION = 4
86 + PATCHLEVEL = 14
87 +-SUBLEVEL = 259
88 ++SUBLEVEL = 260
89 + EXTRAVERSION =
90 + NAME = Petit Gorille
91 +
92 +diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
93 +index f3de76f7ad439..2d8323648256c 100644
94 +--- a/arch/arm/kernel/entry-armv.S
95 ++++ b/arch/arm/kernel/entry-armv.S
96 +@@ -624,11 +624,9 @@ call_fpe:
97 + tstne r0, #0x04000000 @ bit 26 set on both ARM and Thumb-2
98 + reteq lr
99 + and r8, r0, #0x00000f00 @ mask out CP number
100 +- THUMB( lsr r8, r8, #8 )
101 + mov r7, #1
102 +- add r6, r10, #TI_USED_CP
103 +- ARM( strb r7, [r6, r8, lsr #8] ) @ set appropriate used_cp[]
104 +- THUMB( strb r7, [r6, r8] ) @ set appropriate used_cp[]
105 ++ add r6, r10, r8, lsr #8 @ add used_cp[] array offset first
106 ++ strb r7, [r6, #TI_USED_CP] @ set appropriate used_cp[]
107 + #ifdef CONFIG_IWMMXT
108 + @ Test if we need to give access to iWMMXt coprocessors
109 + ldr r5, [r10, #TI_FLAGS]
110 +@@ -637,7 +635,7 @@ call_fpe:
111 + bcs iwmmxt_task_enable
112 + #endif
113 + ARM( add pc, pc, r8, lsr #6 )
114 +- THUMB( lsl r8, r8, #2 )
115 ++ THUMB( lsr r8, r8, #6 )
116 + THUMB( add pc, r8 )
117 + nop
118 +
119 +diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
120 +index 2f7a4018b6e48..2711b63945ae2 100644
121 +--- a/arch/x86/include/asm/pgtable.h
122 ++++ b/arch/x86/include/asm/pgtable.h
123 +@@ -1220,8 +1220,8 @@ static inline pmd_t pmd_swp_clear_soft_dirty(pmd_t pmd)
124 + #endif
125 + #endif
126 +
127 +-#define PKRU_AD_BIT 0x1
128 +-#define PKRU_WD_BIT 0x2
129 ++#define PKRU_AD_BIT 0x1u
130 ++#define PKRU_WD_BIT 0x2u
131 + #define PKRU_BITS_PER_PKEY 2
132 +
133 + static inline bool __pkru_allows_read(u32 pkru, u16 pkey)
134 +diff --git a/drivers/hid/hid-holtek-mouse.c b/drivers/hid/hid-holtek-mouse.c
135 +index 27c08ddab0e1a..96db7e96fcea9 100644
136 +--- a/drivers/hid/hid-holtek-mouse.c
137 ++++ b/drivers/hid/hid-holtek-mouse.c
138 +@@ -68,8 +68,23 @@ static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc,
139 + static int holtek_mouse_probe(struct hid_device *hdev,
140 + const struct hid_device_id *id)
141 + {
142 ++ int ret;
143 ++
144 + if (!hid_is_usb(hdev))
145 + return -EINVAL;
146 ++
147 ++ ret = hid_parse(hdev);
148 ++ if (ret) {
149 ++ hid_err(hdev, "hid parse failed: %d\n", ret);
150 ++ return ret;
151 ++ }
152 ++
153 ++ ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
154 ++ if (ret) {
155 ++ hid_err(hdev, "hw start failed: %d\n", ret);
156 ++ return ret;
157 ++ }
158 ++
159 + return 0;
160 + }
161 +
162 +diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
163 +index c187e557678ef..30a7f7fde6511 100644
164 +--- a/drivers/hwmon/lm90.c
165 ++++ b/drivers/hwmon/lm90.c
166 +@@ -197,6 +197,7 @@ enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680,
167 + #define LM90_STATUS_RHIGH (1 << 4) /* remote high temp limit tripped */
168 + #define LM90_STATUS_LLOW (1 << 5) /* local low temp limit tripped */
169 + #define LM90_STATUS_LHIGH (1 << 6) /* local high temp limit tripped */
170 ++#define LM90_STATUS_BUSY (1 << 7) /* conversion is ongoing */
171 +
172 + #define MAX6696_STATUS2_R2THRM (1 << 1) /* remote2 THERM limit tripped */
173 + #define MAX6696_STATUS2_R2OPEN (1 << 2) /* remote2 is an open circuit */
174 +@@ -786,7 +787,7 @@ static int lm90_update_device(struct device *dev)
175 + val = lm90_read_reg(client, LM90_REG_R_STATUS);
176 + if (val < 0)
177 + return val;
178 +- data->alarms = val; /* lower 8 bit of alarms */
179 ++ data->alarms = val & ~LM90_STATUS_BUSY;
180 +
181 + if (data->kind == max6696) {
182 + val = lm90_select_remote_channel(client, data, 1);
183 +@@ -1439,12 +1440,11 @@ static int lm90_detect(struct i2c_client *client,
184 + if (man_id < 0 || chip_id < 0 || config1 < 0 || convrate < 0)
185 + return -ENODEV;
186 +
187 +- if (man_id == 0x01 || man_id == 0x5C || man_id == 0x41) {
188 ++ if (man_id == 0x01 || man_id == 0x5C || man_id == 0xA1) {
189 + config2 = i2c_smbus_read_byte_data(client, LM90_REG_R_CONFIG2);
190 + if (config2 < 0)
191 + return -ENODEV;
192 +- } else
193 +- config2 = 0; /* Make compiler happy */
194 ++ }
195 +
196 + if ((address == 0x4C || address == 0x4D)
197 + && man_id == 0x01) { /* National Semiconductor */
198 +diff --git a/drivers/infiniband/hw/qib/qib_user_sdma.c b/drivers/infiniband/hw/qib/qib_user_sdma.c
199 +index 42329bbe4055f..0b6379bf76696 100644
200 +--- a/drivers/infiniband/hw/qib/qib_user_sdma.c
201 ++++ b/drivers/infiniband/hw/qib/qib_user_sdma.c
202 +@@ -946,7 +946,7 @@ static int qib_user_sdma_queue_pkts(const struct qib_devdata *dd,
203 + &addrlimit) ||
204 + addrlimit > type_max(typeof(pkt->addrlimit))) {
205 + ret = -EINVAL;
206 +- goto free_pbc;
207 ++ goto free_pkt;
208 + }
209 + pkt->addrlimit = addrlimit;
210 +
211 +diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
212 +index 138d1f3b12b2e..366990fa01b99 100644
213 +--- a/drivers/input/touchscreen/atmel_mxt_ts.c
214 ++++ b/drivers/input/touchscreen/atmel_mxt_ts.c
215 +@@ -1768,7 +1768,7 @@ static int mxt_read_info_block(struct mxt_data *data)
216 + if (error) {
217 + dev_err(&client->dev, "Error %d parsing object table\n", error);
218 + mxt_free_object_table(data);
219 +- goto err_free_mem;
220 ++ return error;
221 + }
222 +
223 + data->object_table = (struct mxt_object *)(id_buf + MXT_OBJECT_START);
224 +diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
225 +index f24df859f0a7e..1e81b1cafae35 100644
226 +--- a/drivers/net/bonding/bond_options.c
227 ++++ b/drivers/net/bonding/bond_options.c
228 +@@ -1443,7 +1443,7 @@ static int bond_option_ad_actor_system_set(struct bonding *bond,
229 + mac = (u8 *)&newval->value;
230 + }
231 +
232 +- if (!is_valid_ether_addr(mac))
233 ++ if (is_multicast_ether_addr(mac))
234 + goto err;
235 +
236 + netdev_dbg(bond->dev, "Setting ad_actor_system to %pM\n", mac);
237 +diff --git a/drivers/net/can/usb/kvaser_usb.c b/drivers/net/can/usb/kvaser_usb.c
238 +index 2b994bbf85ca3..9742e32d5cd54 100644
239 +--- a/drivers/net/can/usb/kvaser_usb.c
240 ++++ b/drivers/net/can/usb/kvaser_usb.c
241 +@@ -31,7 +31,10 @@
242 + #define USB_SEND_TIMEOUT 1000 /* msecs */
243 + #define USB_RECV_TIMEOUT 1000 /* msecs */
244 + #define RX_BUFFER_SIZE 3072
245 +-#define CAN_USB_CLOCK 8000000
246 ++#define KVASER_USB_CAN_CLOCK_8MHZ 8000000
247 ++#define KVASER_USB_CAN_CLOCK_16MHZ 16000000
248 ++#define KVASER_USB_CAN_CLOCK_24MHZ 24000000
249 ++#define KVASER_USB_CAN_CLOCK_32MHZ 32000000
250 + #define MAX_NET_DEVICES 3
251 + #define MAX_USBCAN_NET_DEVICES 2
252 +
253 +@@ -142,6 +145,12 @@ static inline bool kvaser_is_usbcan(const struct usb_device_id *id)
254 + #define CMD_LEAF_USB_THROTTLE 77
255 + #define CMD_LEAF_LOG_MESSAGE 106
256 +
257 ++/* Leaf frequency options */
258 ++#define KVASER_USB_LEAF_SWOPTION_FREQ_MASK 0x60
259 ++#define KVASER_USB_LEAF_SWOPTION_FREQ_16_MHZ_CLK 0
260 ++#define KVASER_USB_LEAF_SWOPTION_FREQ_32_MHZ_CLK BIT(5)
261 ++#define KVASER_USB_LEAF_SWOPTION_FREQ_24_MHZ_CLK BIT(6)
262 ++
263 + /* error factors */
264 + #define M16C_EF_ACKE BIT(0)
265 + #define M16C_EF_CRCE BIT(1)
266 +@@ -472,6 +481,8 @@ struct kvaser_usb {
267 + bool rxinitdone;
268 + void *rxbuf[MAX_RX_URBS];
269 + dma_addr_t rxbuf_dma[MAX_RX_URBS];
270 ++
271 ++ struct can_clock clock;
272 + };
273 +
274 + struct kvaser_usb_net_priv {
275 +@@ -652,6 +663,27 @@ static int kvaser_usb_send_simple_msg(const struct kvaser_usb *dev,
276 + return rc;
277 + }
278 +
279 ++static void kvaser_usb_get_software_info_leaf(struct kvaser_usb *dev,
280 ++ const struct leaf_msg_softinfo *softinfo)
281 ++{
282 ++ u32 sw_options = le32_to_cpu(softinfo->sw_options);
283 ++
284 ++ dev->fw_version = le32_to_cpu(softinfo->fw_version);
285 ++ dev->max_tx_urbs = le16_to_cpu(softinfo->max_outstanding_tx);
286 ++
287 ++ switch (sw_options & KVASER_USB_LEAF_SWOPTION_FREQ_MASK) {
288 ++ case KVASER_USB_LEAF_SWOPTION_FREQ_16_MHZ_CLK:
289 ++ dev->clock.freq = KVASER_USB_CAN_CLOCK_16MHZ;
290 ++ break;
291 ++ case KVASER_USB_LEAF_SWOPTION_FREQ_24_MHZ_CLK:
292 ++ dev->clock.freq = KVASER_USB_CAN_CLOCK_24MHZ;
293 ++ break;
294 ++ case KVASER_USB_LEAF_SWOPTION_FREQ_32_MHZ_CLK:
295 ++ dev->clock.freq = KVASER_USB_CAN_CLOCK_32MHZ;
296 ++ break;
297 ++ }
298 ++}
299 ++
300 + static int kvaser_usb_get_software_info(struct kvaser_usb *dev)
301 + {
302 + struct kvaser_msg msg;
303 +@@ -667,14 +699,13 @@ static int kvaser_usb_get_software_info(struct kvaser_usb *dev)
304 +
305 + switch (dev->family) {
306 + case KVASER_LEAF:
307 +- dev->fw_version = le32_to_cpu(msg.u.leaf.softinfo.fw_version);
308 +- dev->max_tx_urbs =
309 +- le16_to_cpu(msg.u.leaf.softinfo.max_outstanding_tx);
310 ++ kvaser_usb_get_software_info_leaf(dev, &msg.u.leaf.softinfo);
311 + break;
312 + case KVASER_USBCAN:
313 + dev->fw_version = le32_to_cpu(msg.u.usbcan.softinfo.fw_version);
314 + dev->max_tx_urbs =
315 + le16_to_cpu(msg.u.usbcan.softinfo.max_outstanding_tx);
316 ++ dev->clock.freq = KVASER_USB_CAN_CLOCK_8MHZ;
317 + break;
318 + }
319 +
320 +@@ -1926,7 +1957,7 @@ static int kvaser_usb_init_one(struct usb_interface *intf,
321 + kvaser_usb_reset_tx_urb_contexts(priv);
322 +
323 + priv->can.state = CAN_STATE_STOPPED;
324 +- priv->can.clock.freq = CAN_USB_CLOCK;
325 ++ priv->can.clock.freq = dev->clock.freq;
326 + priv->can.bittiming_const = &kvaser_usb_bittiming_const;
327 + priv->can.do_set_bittiming = kvaser_usb_set_bittiming;
328 + priv->can.do_set_mode = kvaser_usb_set_mode;
329 +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h
330 +index 5f327659efa7a..85b688f60b876 100644
331 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h
332 ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h
333 +@@ -202,7 +202,7 @@ int qlcnic_sriov_get_vf_vport_info(struct qlcnic_adapter *,
334 + struct qlcnic_info *, u16);
335 + int qlcnic_sriov_cfg_vf_guest_vlan(struct qlcnic_adapter *, u16, u8);
336 + void qlcnic_sriov_free_vlans(struct qlcnic_adapter *);
337 +-void qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *);
338 ++int qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *);
339 + bool qlcnic_sriov_check_any_vlan(struct qlcnic_vf_info *);
340 + void qlcnic_sriov_del_vlan_id(struct qlcnic_sriov *,
341 + struct qlcnic_vf_info *, u16);
342 +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
343 +index c58180f408448..44caa7c2077ec 100644
344 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
345 ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
346 +@@ -433,7 +433,7 @@ static int qlcnic_sriov_set_guest_vlan_mode(struct qlcnic_adapter *adapter,
347 + struct qlcnic_cmd_args *cmd)
348 + {
349 + struct qlcnic_sriov *sriov = adapter->ahw->sriov;
350 +- int i, num_vlans;
351 ++ int i, num_vlans, ret;
352 + u16 *vlans;
353 +
354 + if (sriov->allowed_vlans)
355 +@@ -444,7 +444,9 @@ static int qlcnic_sriov_set_guest_vlan_mode(struct qlcnic_adapter *adapter,
356 + dev_info(&adapter->pdev->dev, "Number of allowed Guest VLANs = %d\n",
357 + sriov->num_allowed_vlans);
358 +
359 +- qlcnic_sriov_alloc_vlans(adapter);
360 ++ ret = qlcnic_sriov_alloc_vlans(adapter);
361 ++ if (ret)
362 ++ return ret;
363 +
364 + if (!sriov->any_vlan)
365 + return 0;
366 +@@ -2164,7 +2166,7 @@ static int qlcnic_sriov_vf_resume(struct qlcnic_adapter *adapter)
367 + return err;
368 + }
369 +
370 +-void qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *adapter)
371 ++int qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *adapter)
372 + {
373 + struct qlcnic_sriov *sriov = adapter->ahw->sriov;
374 + struct qlcnic_vf_info *vf;
375 +@@ -2174,7 +2176,11 @@ void qlcnic_sriov_alloc_vlans(struct qlcnic_adapter *adapter)
376 + vf = &sriov->vf_info[i];
377 + vf->sriov_vlans = kcalloc(sriov->num_allowed_vlans,
378 + sizeof(*vf->sriov_vlans), GFP_KERNEL);
379 ++ if (!vf->sriov_vlans)
380 ++ return -ENOMEM;
381 + }
382 ++
383 ++ return 0;
384 + }
385 +
386 + void qlcnic_sriov_free_vlans(struct qlcnic_adapter *adapter)
387 +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
388 +index 50eaafa3eaba3..c9f2cd2462230 100644
389 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
390 ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
391 +@@ -598,7 +598,9 @@ static int __qlcnic_pci_sriov_enable(struct qlcnic_adapter *adapter,
392 + if (err)
393 + goto del_flr_queue;
394 +
395 +- qlcnic_sriov_alloc_vlans(adapter);
396 ++ err = qlcnic_sriov_alloc_vlans(adapter);
397 ++ if (err)
398 ++ goto del_flr_queue;
399 +
400 + return err;
401 +
402 +diff --git a/drivers/net/ethernet/sfc/falcon/rx.c b/drivers/net/ethernet/sfc/falcon/rx.c
403 +index 6a8406dc0c2b4..06f556d373949 100644
404 +--- a/drivers/net/ethernet/sfc/falcon/rx.c
405 ++++ b/drivers/net/ethernet/sfc/falcon/rx.c
406 +@@ -732,7 +732,10 @@ static void ef4_init_rx_recycle_ring(struct ef4_nic *efx,
407 + efx->rx_bufs_per_page);
408 + rx_queue->page_ring = kcalloc(page_ring_size,
409 + sizeof(*rx_queue->page_ring), GFP_KERNEL);
410 +- rx_queue->page_ptr_mask = page_ring_size - 1;
411 ++ if (!rx_queue->page_ring)
412 ++ rx_queue->page_ptr_mask = 0;
413 ++ else
414 ++ rx_queue->page_ptr_mask = page_ring_size - 1;
415 + }
416 +
417 + void ef4_init_rx_queue(struct ef4_rx_queue *rx_queue)
418 +diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c
419 +index f4f52a64f450a..56865ddd32502 100644
420 +--- a/drivers/net/ethernet/smsc/smc911x.c
421 ++++ b/drivers/net/ethernet/smsc/smc911x.c
422 +@@ -2089,6 +2089,11 @@ static int smc911x_drv_probe(struct platform_device *pdev)
423 +
424 + ndev->dma = (unsigned char)-1;
425 + ndev->irq = platform_get_irq(pdev, 0);
426 ++ if (ndev->irq < 0) {
427 ++ ret = ndev->irq;
428 ++ goto release_both;
429 ++ }
430 ++
431 + lp = netdev_priv(ndev);
432 + lp->netdev = ndev;
433 + #ifdef SMC_DYNAMIC_BUS_CONFIG
434 +diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c
435 +index 26d3051591dac..9e8add3d93adc 100644
436 +--- a/drivers/net/fjes/fjes_main.c
437 ++++ b/drivers/net/fjes/fjes_main.c
438 +@@ -1284,6 +1284,11 @@ static int fjes_probe(struct platform_device *plat_dev)
439 + hw->hw_res.start = res->start;
440 + hw->hw_res.size = resource_size(res);
441 + hw->hw_res.irq = platform_get_irq(plat_dev, 0);
442 ++ if (hw->hw_res.irq < 0) {
443 ++ err = hw->hw_res.irq;
444 ++ goto err_free_control_wq;
445 ++ }
446 ++
447 + err = fjes_hw_init(&adapter->hw);
448 + if (err)
449 + goto err_free_control_wq;
450 +diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
451 +index 2074fc55a88ad..cbd637a3257bb 100644
452 +--- a/drivers/net/hamradio/mkiss.c
453 ++++ b/drivers/net/hamradio/mkiss.c
454 +@@ -803,13 +803,14 @@ static void mkiss_close(struct tty_struct *tty)
455 + */
456 + netif_stop_queue(ax->dev);
457 +
458 +- /* Free all AX25 frame buffers. */
459 ++ unregister_netdev(ax->dev);
460 ++
461 ++ /* Free all AX25 frame buffers after unreg. */
462 + kfree(ax->rbuff);
463 + kfree(ax->xbuff);
464 +
465 + ax->tty = NULL;
466 +
467 +- unregister_netdev(ax->dev);
468 + free_netdev(ax->dev);
469 + }
470 +
471 +diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
472 +index e286188b6ea1b..d6a71c051ec1b 100644
473 +--- a/drivers/net/usb/lan78xx.c
474 ++++ b/drivers/net/usb/lan78xx.c
475 +@@ -74,6 +74,8 @@
476 + #define LAN7801_USB_PRODUCT_ID (0x7801)
477 + #define LAN78XX_EEPROM_MAGIC (0x78A5)
478 + #define LAN78XX_OTP_MAGIC (0x78F3)
479 ++#define AT29M2AF_USB_VENDOR_ID (0x07C9)
480 ++#define AT29M2AF_USB_PRODUCT_ID (0x0012)
481 +
482 + #define MII_READ 1
483 + #define MII_WRITE 0
484 +@@ -4013,6 +4015,10 @@ static const struct usb_device_id products[] = {
485 + /* LAN7801 USB Gigabit Ethernet Device */
486 + USB_DEVICE(LAN78XX_USB_VENDOR_ID, LAN7801_USB_PRODUCT_ID),
487 + },
488 ++ {
489 ++ /* ATM2-AF USB Gigabit Ethernet Device */
490 ++ USB_DEVICE(AT29M2AF_USB_VENDOR_ID, AT29M2AF_USB_PRODUCT_ID),
491 ++ },
492 + {},
493 + };
494 + MODULE_DEVICE_TABLE(usb, products);
495 +diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
496 +index b38e82a868df8..08d0fa00bed48 100644
497 +--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
498 ++++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
499 +@@ -989,10 +989,10 @@ static int stm32_gpiolib_register_bank(struct stm32_pinctrl *pctl,
500 + bank_nr = args.args[1] / STM32_GPIO_PINS_PER_BANK;
501 + bank->gpio_chip.base = args.args[1];
502 +
503 +- npins = args.args[2];
504 +- while (!of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3,
505 +- ++i, &args))
506 +- npins += args.args[2];
507 ++ /* get the last defined gpio line (offset + nb of pins) */
508 ++ npins = args.args[0] + args.args[2];
509 ++ while (!of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, ++i, &args))
510 ++ npins = max(npins, (int)(args.args[0] + args.args[2]));
511 + } else {
512 + bank_nr = pctl->nbanks;
513 + bank->gpio_chip.base = bank_nr * STM32_GPIO_PINS_PER_BANK;
514 +diff --git a/drivers/spi/spi-armada-3700.c b/drivers/spi/spi-armada-3700.c
515 +index 4903f15177cfd..8fedf83585d41 100644
516 +--- a/drivers/spi/spi-armada-3700.c
517 ++++ b/drivers/spi/spi-armada-3700.c
518 +@@ -852,7 +852,7 @@ static int a3700_spi_probe(struct platform_device *pdev)
519 + return 0;
520 +
521 + error_clk:
522 +- clk_disable_unprepare(spi->clk);
523 ++ clk_unprepare(spi->clk);
524 + error:
525 + spi_master_put(master);
526 + out:
527 +diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
528 +index 38a35f57b22c0..f59c20457e658 100644
529 +--- a/drivers/usb/gadget/function/u_ether.c
530 ++++ b/drivers/usb/gadget/function/u_ether.c
531 +@@ -864,19 +864,23 @@ int gether_register_netdev(struct net_device *net)
532 + {
533 + struct eth_dev *dev;
534 + struct usb_gadget *g;
535 +- struct sockaddr sa;
536 + int status;
537 +
538 + if (!net->dev.parent)
539 + return -EINVAL;
540 + dev = netdev_priv(net);
541 + g = dev->gadget;
542 ++
543 ++ memcpy(net->dev_addr, dev->dev_mac, ETH_ALEN);
544 ++ net->addr_assign_type = NET_ADDR_RANDOM;
545 ++
546 + status = register_netdev(net);
547 + if (status < 0) {
548 + dev_dbg(&g->dev, "register_netdev failed, %d\n", status);
549 + return status;
550 + } else {
551 + INFO(dev, "HOST MAC %pM\n", dev->host_mac);
552 ++ INFO(dev, "MAC %pM\n", dev->dev_mac);
553 +
554 + /* two kinds of host-initiated state changes:
555 + * - iff DATA transfer is active, carrier is "on"
556 +@@ -884,15 +888,6 @@ int gether_register_netdev(struct net_device *net)
557 + */
558 + netif_carrier_off(net);
559 + }
560 +- sa.sa_family = net->type;
561 +- memcpy(sa.sa_data, dev->dev_mac, ETH_ALEN);
562 +- rtnl_lock();
563 +- status = dev_set_mac_address(net, &sa);
564 +- rtnl_unlock();
565 +- if (status)
566 +- pr_warn("cannot set self ethernet address: %d\n", status);
567 +- else
568 +- INFO(dev, "MAC %pM\n", dev->dev_mac);
569 +
570 + return status;
571 + }
572 +diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c
573 +index 89c975126d4e8..b3c64ab0d5a56 100644
574 +--- a/fs/f2fs/xattr.c
575 ++++ b/fs/f2fs/xattr.c
576 +@@ -636,8 +636,15 @@ static int __f2fs_setxattr(struct inode *inode, int index,
577 + }
578 +
579 + last = here;
580 +- while (!IS_XATTR_LAST_ENTRY(last))
581 ++ while (!IS_XATTR_LAST_ENTRY(last)) {
582 ++ if ((void *)(last) + sizeof(__u32) > last_base_addr ||
583 ++ (void *)XATTR_NEXT_ENTRY(last) > last_base_addr) {
584 ++ set_sbi_flag(F2FS_I_SB(inode), SBI_NEED_FSCK);
585 ++ error = -EFSCORRUPTED;
586 ++ goto exit;
587 ++ }
588 + last = XATTR_NEXT_ENTRY(last);
589 ++ }
590 +
591 + newsize = XATTR_ALIGN(sizeof(struct f2fs_xattr_entry) + len + size);
592 +
593 +diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
594 +index 162761f72c142..db8ab0fac81a2 100644
595 +--- a/include/linux/virtio_net.h
596 ++++ b/include/linux/virtio_net.h
597 +@@ -7,9 +7,27 @@
598 + #include <uapi/linux/udp.h>
599 + #include <uapi/linux/virtio_net.h>
600 +
601 ++static inline bool virtio_net_hdr_match_proto(__be16 protocol, __u8 gso_type)
602 ++{
603 ++ switch (gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
604 ++ case VIRTIO_NET_HDR_GSO_TCPV4:
605 ++ return protocol == cpu_to_be16(ETH_P_IP);
606 ++ case VIRTIO_NET_HDR_GSO_TCPV6:
607 ++ return protocol == cpu_to_be16(ETH_P_IPV6);
608 ++ case VIRTIO_NET_HDR_GSO_UDP:
609 ++ return protocol == cpu_to_be16(ETH_P_IP) ||
610 ++ protocol == cpu_to_be16(ETH_P_IPV6);
611 ++ default:
612 ++ return false;
613 ++ }
614 ++}
615 ++
616 + static inline int virtio_net_hdr_set_proto(struct sk_buff *skb,
617 + const struct virtio_net_hdr *hdr)
618 + {
619 ++ if (skb->protocol)
620 ++ return 0;
621 ++
622 + switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
623 + case VIRTIO_NET_HDR_GSO_TCPV4:
624 + case VIRTIO_NET_HDR_GSO_UDP:
625 +@@ -88,9 +106,12 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,
626 + if (!skb->protocol) {
627 + __be16 protocol = dev_parse_header_protocol(skb);
628 +
629 +- virtio_net_hdr_set_proto(skb, hdr);
630 +- if (protocol && protocol != skb->protocol)
631 ++ if (!protocol)
632 ++ virtio_net_hdr_set_proto(skb, hdr);
633 ++ else if (!virtio_net_hdr_match_proto(protocol, hdr->gso_type))
634 + return -EINVAL;
635 ++ else
636 ++ skb->protocol = protocol;
637 + }
638 + retry:
639 + if (!skb_flow_dissect_flow_keys(skb, &keys, 0)) {
640 +diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
641 +index 6915eebc7a4a9..0232afd9d9c3c 100644
642 +--- a/net/ax25/af_ax25.c
643 ++++ b/net/ax25/af_ax25.c
644 +@@ -88,8 +88,10 @@ static void ax25_kill_by_device(struct net_device *dev)
645 + again:
646 + ax25_for_each(s, &ax25_list) {
647 + if (s->ax25_dev == ax25_dev) {
648 +- s->ax25_dev = NULL;
649 + spin_unlock_bh(&ax25_list_lock);
650 ++ lock_sock(s->sk);
651 ++ s->ax25_dev = NULL;
652 ++ release_sock(s->sk);
653 + ax25_disconnect(s, ENETUNREACH);
654 + spin_lock_bh(&ax25_list_lock);
655 +
656 +diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
657 +index cad6498f10b03..0ccc7c851a788 100644
658 +--- a/net/netfilter/nfnetlink_log.c
659 ++++ b/net/netfilter/nfnetlink_log.c
660 +@@ -510,7 +510,8 @@ __build_packet_message(struct nfnl_log_net *log,
661 + goto nla_put_failure;
662 +
663 + if (indev && skb->dev &&
664 +- skb->mac_header != skb->network_header) {
665 ++ skb_mac_header_was_set(skb) &&
666 ++ skb_mac_header_len(skb) != 0) {
667 + struct nfulnl_msg_packet_hw phw;
668 + int len;
669 +
670 +diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
671 +index 13e67eb75d841..26f563bbb58de 100644
672 +--- a/net/netfilter/nfnetlink_queue.c
673 ++++ b/net/netfilter/nfnetlink_queue.c
674 +@@ -543,7 +543,8 @@ nfqnl_build_packet_message(struct net *net, struct nfqnl_instance *queue,
675 + goto nla_put_failure;
676 +
677 + if (indev && entskb->dev &&
678 +- skb_mac_header_was_set(entskb)) {
679 ++ skb_mac_header_was_set(entskb) &&
680 ++ skb_mac_header_len(entskb) != 0) {
681 + struct nfqnl_msg_packet_hw phw;
682 + int len;
683 +
684 +diff --git a/net/phonet/pep.c b/net/phonet/pep.c
685 +index bffcef58ebf5c..b0d958cd1823e 100644
686 +--- a/net/phonet/pep.c
687 ++++ b/net/phonet/pep.c
688 +@@ -959,6 +959,8 @@ static int pep_ioctl(struct sock *sk, int cmd, unsigned long arg)
689 + ret = -EBUSY;
690 + else if (sk->sk_state == TCP_ESTABLISHED)
691 + ret = -EISCONN;
692 ++ else if (!pn->pn_sk.sobject)
693 ++ ret = -EADDRNOTAVAIL;
694 + else
695 + ret = pep_sock_enable(sk, NULL, 0);
696 + release_sock(sk);
697 +diff --git a/sound/core/jack.c b/sound/core/jack.c
698 +index f652e90efd7e7..5ddf81f091fa9 100644
699 +--- a/sound/core/jack.c
700 ++++ b/sound/core/jack.c
701 +@@ -234,6 +234,10 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
702 + return -ENOMEM;
703 +
704 + jack->id = kstrdup(id, GFP_KERNEL);
705 ++ if (jack->id == NULL) {
706 ++ kfree(jack);
707 ++ return -ENOMEM;
708 ++ }
709 +
710 + /* don't creat input device for phantom jack */
711 + if (!phantom_jack) {
712 +diff --git a/sound/drivers/opl3/opl3_midi.c b/sound/drivers/opl3/opl3_midi.c
713 +index 13c0a7e1bc2b0..5f934b2f14869 100644
714 +--- a/sound/drivers/opl3/opl3_midi.c
715 ++++ b/sound/drivers/opl3/opl3_midi.c
716 +@@ -415,7 +415,7 @@ void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
717 + }
718 + if (instr_4op) {
719 + vp2 = &opl3->voices[voice + 3];
720 +- if (vp->state > 0) {
721 ++ if (vp2->state > 0) {
722 + opl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK +
723 + voice_offset + 3);
724 + reg_val = vp->keyon_reg & ~OPL3_KEYON_BIT;