1 |
commit: 4b38ac2afb82a199ef71796c5885599f3e188e93 |
2 |
Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Apr 16 11:20:13 2021 +0000 |
4 |
Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Apr 16 11:20:25 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=4b38ac2a |
7 |
|
8 |
Linux patch 4.4.267 |
9 |
|
10 |
Signed-off-by: Alice Ferrazzi <alicef <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1266_linux-4.4.267.patch | 849 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 853 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 926141b..074f637 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -1107,6 +1107,10 @@ Patch: 1265_linux-4.4.266.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.4.266 |
23 |
|
24 |
+Patch: 1266_linux-4.4.267.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.4.267 |
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/1266_linux-4.4.267.patch b/1266_linux-4.4.267.patch |
33 |
new file mode 100644 |
34 |
index 0000000..cfafcbf |
35 |
--- /dev/null |
36 |
+++ b/1266_linux-4.4.267.patch |
37 |
@@ -0,0 +1,849 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 8863ee364e7e7..8a564934a742e 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,6 +1,6 @@ |
43 |
+ VERSION = 4 |
44 |
+ PATCHLEVEL = 4 |
45 |
+-SUBLEVEL = 266 |
46 |
++SUBLEVEL = 267 |
47 |
+ EXTRAVERSION = |
48 |
+ NAME = Blurry Fish Butt |
49 |
+ |
50 |
+diff --git a/arch/ia64/include/asm/ptrace.h b/arch/ia64/include/asm/ptrace.h |
51 |
+index 845143990a1d6..9d3d4fb87a7a3 100644 |
52 |
+--- a/arch/ia64/include/asm/ptrace.h |
53 |
++++ b/arch/ia64/include/asm/ptrace.h |
54 |
+@@ -53,8 +53,7 @@ |
55 |
+ |
56 |
+ static inline unsigned long user_stack_pointer(struct pt_regs *regs) |
57 |
+ { |
58 |
+- /* FIXME: should this be bspstore + nr_dirty regs? */ |
59 |
+- return regs->ar_bspstore; |
60 |
++ return regs->r12; |
61 |
+ } |
62 |
+ |
63 |
+ static inline int is_syscall_success(struct pt_regs *regs) |
64 |
+@@ -78,11 +77,6 @@ static inline long regs_return_value(struct pt_regs *regs) |
65 |
+ unsigned long __ip = instruction_pointer(regs); \ |
66 |
+ (__ip & ~3UL) + ((__ip & 3UL) << 2); \ |
67 |
+ }) |
68 |
+-/* |
69 |
+- * Why not default? Because user_stack_pointer() on ia64 gives register |
70 |
+- * stack backing store instead... |
71 |
+- */ |
72 |
+-#define current_user_stack_pointer() (current_pt_regs()->r12) |
73 |
+ |
74 |
+ /* given a pointer to a task_struct, return the user's pt_regs */ |
75 |
+ # define task_pt_regs(t) (((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1) |
76 |
+diff --git a/arch/s390/kernel/cpcmd.c b/arch/s390/kernel/cpcmd.c |
77 |
+index 7f768914fb4f9..c15546c6fb66d 100644 |
78 |
+--- a/arch/s390/kernel/cpcmd.c |
79 |
++++ b/arch/s390/kernel/cpcmd.c |
80 |
+@@ -37,10 +37,12 @@ static int diag8_noresponse(int cmdlen) |
81 |
+ |
82 |
+ static int diag8_response(int cmdlen, char *response, int *rlen) |
83 |
+ { |
84 |
++ unsigned long _cmdlen = cmdlen | 0x40000000L; |
85 |
++ unsigned long _rlen = *rlen; |
86 |
+ register unsigned long reg2 asm ("2") = (addr_t) cpcmd_buf; |
87 |
+ register unsigned long reg3 asm ("3") = (addr_t) response; |
88 |
+- register unsigned long reg4 asm ("4") = cmdlen | 0x40000000L; |
89 |
+- register unsigned long reg5 asm ("5") = *rlen; |
90 |
++ register unsigned long reg4 asm ("4") = _cmdlen; |
91 |
++ register unsigned long reg5 asm ("5") = _rlen; |
92 |
+ |
93 |
+ asm volatile( |
94 |
+ " sam31\n" |
95 |
+diff --git a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig |
96 |
+index c528f96ee204f..07de755ca30c5 100644 |
97 |
+--- a/drivers/char/agp/Kconfig |
98 |
++++ b/drivers/char/agp/Kconfig |
99 |
+@@ -124,7 +124,7 @@ config AGP_HP_ZX1 |
100 |
+ |
101 |
+ config AGP_PARISC |
102 |
+ tristate "HP Quicksilver AGP support" |
103 |
+- depends on AGP && PARISC && 64BIT |
104 |
++ depends on AGP && PARISC && 64BIT && IOMMU_SBA |
105 |
+ help |
106 |
+ This option gives you AGP GART support for the HP Quicksilver |
107 |
+ AGP bus adapter on HP PA-RISC machines (Ok, just on the C8000 |
108 |
+diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c |
109 |
+index 53c068f90b376..c46fff3a32feb 100644 |
110 |
+--- a/drivers/clk/clk.c |
111 |
++++ b/drivers/clk/clk.c |
112 |
+@@ -2870,32 +2870,28 @@ EXPORT_SYMBOL_GPL(clk_notifier_register); |
113 |
+ */ |
114 |
+ int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb) |
115 |
+ { |
116 |
+- struct clk_notifier *cn = NULL; |
117 |
+- int ret = -EINVAL; |
118 |
++ struct clk_notifier *cn; |
119 |
++ int ret = -ENOENT; |
120 |
+ |
121 |
+ if (!clk || !nb) |
122 |
+ return -EINVAL; |
123 |
+ |
124 |
+ clk_prepare_lock(); |
125 |
+ |
126 |
+- list_for_each_entry(cn, &clk_notifier_list, node) |
127 |
+- if (cn->clk == clk) |
128 |
+- break; |
129 |
+- |
130 |
+- if (cn->clk == clk) { |
131 |
+- ret = srcu_notifier_chain_unregister(&cn->notifier_head, nb); |
132 |
++ list_for_each_entry(cn, &clk_notifier_list, node) { |
133 |
++ if (cn->clk == clk) { |
134 |
++ ret = srcu_notifier_chain_unregister(&cn->notifier_head, nb); |
135 |
+ |
136 |
+- clk->core->notifier_count--; |
137 |
++ clk->core->notifier_count--; |
138 |
+ |
139 |
+- /* XXX the notifier code should handle this better */ |
140 |
+- if (!cn->notifier_head.head) { |
141 |
+- srcu_cleanup_notifier_head(&cn->notifier_head); |
142 |
+- list_del(&cn->node); |
143 |
+- kfree(cn); |
144 |
++ /* XXX the notifier code should handle this better */ |
145 |
++ if (!cn->notifier_head.head) { |
146 |
++ srcu_cleanup_notifier_head(&cn->notifier_head); |
147 |
++ list_del(&cn->node); |
148 |
++ kfree(cn); |
149 |
++ } |
150 |
++ break; |
151 |
+ } |
152 |
+- |
153 |
+- } else { |
154 |
+- ret = -ENOENT; |
155 |
+ } |
156 |
+ |
157 |
+ clk_prepare_unlock(); |
158 |
+diff --git a/drivers/clk/socfpga/clk-gate.c b/drivers/clk/socfpga/clk-gate.c |
159 |
+index aa7a6e6a15b65..14918896811d6 100644 |
160 |
+--- a/drivers/clk/socfpga/clk-gate.c |
161 |
++++ b/drivers/clk/socfpga/clk-gate.c |
162 |
+@@ -107,7 +107,7 @@ static unsigned long socfpga_clk_recalc_rate(struct clk_hw *hwclk, |
163 |
+ val = readl(socfpgaclk->div_reg) >> socfpgaclk->shift; |
164 |
+ val &= GENMASK(socfpgaclk->width - 1, 0); |
165 |
+ /* Check for GPIO_DB_CLK by its offset */ |
166 |
+- if ((int) socfpgaclk->div_reg & SOCFPGA_GPIO_DB_CLK_OFFSET) |
167 |
++ if ((uintptr_t) socfpgaclk->div_reg & SOCFPGA_GPIO_DB_CLK_OFFSET) |
168 |
+ div = val + 1; |
169 |
+ else |
170 |
+ div = (1 << val); |
171 |
+diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c |
172 |
+index b9dc2ef64ed88..74585ba165018 100644 |
173 |
+--- a/drivers/gpu/drm/imx/imx-ldb.c |
174 |
++++ b/drivers/gpu/drm/imx/imx-ldb.c |
175 |
+@@ -217,6 +217,11 @@ static void imx_ldb_encoder_commit(struct drm_encoder *encoder) |
176 |
+ int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN; |
177 |
+ int mux = imx_drm_encoder_get_mux_id(imx_ldb_ch->child, encoder); |
178 |
+ |
179 |
++ if (mux < 0 || mux >= ARRAY_SIZE(ldb->clk_sel)) { |
180 |
++ dev_warn(ldb->dev, "%s: invalid mux %d\n", __func__, mux); |
181 |
++ return; |
182 |
++ } |
183 |
++ |
184 |
+ drm_panel_prepare(imx_ldb_ch->panel); |
185 |
+ |
186 |
+ if (dual) { |
187 |
+@@ -267,6 +272,11 @@ static void imx_ldb_encoder_mode_set(struct drm_encoder *encoder, |
188 |
+ unsigned long di_clk = mode->clock * 1000; |
189 |
+ int mux = imx_drm_encoder_get_mux_id(imx_ldb_ch->child, encoder); |
190 |
+ |
191 |
++ if (mux < 0 || mux >= ARRAY_SIZE(ldb->clk_sel)) { |
192 |
++ dev_warn(ldb->dev, "%s: invalid mux %d\n", __func__, mux); |
193 |
++ return; |
194 |
++ } |
195 |
++ |
196 |
+ if (mode->clock > 170000) { |
197 |
+ dev_warn(ldb->dev, |
198 |
+ "%s: mode exceeds 170 MHz pixel clock\n", __func__); |
199 |
+diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c |
200 |
+index 45ca056f019ed..63041dcec7afd 100644 |
201 |
+--- a/drivers/iio/light/hid-sensor-prox.c |
202 |
++++ b/drivers/iio/light/hid-sensor-prox.c |
203 |
+@@ -37,6 +37,9 @@ struct prox_state { |
204 |
+ struct hid_sensor_common common_attributes; |
205 |
+ struct hid_sensor_hub_attribute_info prox_attr; |
206 |
+ u32 human_presence; |
207 |
++ int scale_pre_decml; |
208 |
++ int scale_post_decml; |
209 |
++ int scale_precision; |
210 |
+ }; |
211 |
+ |
212 |
+ /* Channel definitions */ |
213 |
+@@ -105,8 +108,9 @@ static int prox_read_raw(struct iio_dev *indio_dev, |
214 |
+ ret_type = IIO_VAL_INT; |
215 |
+ break; |
216 |
+ case IIO_CHAN_INFO_SCALE: |
217 |
+- *val = prox_state->prox_attr.units; |
218 |
+- ret_type = IIO_VAL_INT; |
219 |
++ *val = prox_state->scale_pre_decml; |
220 |
++ *val2 = prox_state->scale_post_decml; |
221 |
++ ret_type = prox_state->scale_precision; |
222 |
+ break; |
223 |
+ case IIO_CHAN_INFO_OFFSET: |
224 |
+ *val = hid_sensor_convert_exponent( |
225 |
+@@ -240,6 +244,12 @@ static int prox_parse_report(struct platform_device *pdev, |
226 |
+ st->common_attributes.sensitivity.index, |
227 |
+ st->common_attributes.sensitivity.report_id); |
228 |
+ } |
229 |
++ |
230 |
++ st->scale_precision = hid_sensor_format_scale( |
231 |
++ hsdev->usage, |
232 |
++ &st->prox_attr, |
233 |
++ &st->scale_pre_decml, &st->scale_post_decml); |
234 |
++ |
235 |
+ return ret; |
236 |
+ } |
237 |
+ |
238 |
+diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c |
239 |
+index 8d75161854eec..f422a8a2528b9 100644 |
240 |
+--- a/drivers/infiniband/hw/cxgb4/cm.c |
241 |
++++ b/drivers/infiniband/hw/cxgb4/cm.c |
242 |
+@@ -3447,7 +3447,8 @@ int c4iw_destroy_listen(struct iw_cm_id *cm_id) |
243 |
+ c4iw_init_wr_wait(&ep->com.wr_wait); |
244 |
+ err = cxgb4_remove_server( |
245 |
+ ep->com.dev->rdev.lldi.ports[0], ep->stid, |
246 |
+- ep->com.dev->rdev.lldi.rxq_ids[0], true); |
247 |
++ ep->com.dev->rdev.lldi.rxq_ids[0], |
248 |
++ ep->com.local_addr.ss_family == AF_INET6); |
249 |
+ if (err) |
250 |
+ goto done; |
251 |
+ err = c4iw_wait_for_reply(&ep->com.dev->rdev, &ep->com.wr_wait, |
252 |
+diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c |
253 |
+index 7b148174eb760..620db93ab9a3d 100644 |
254 |
+--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c |
255 |
++++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c |
256 |
+@@ -882,7 +882,7 @@ static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter, |
257 |
+ if (dev->adapter->dev_set_bus) { |
258 |
+ err = dev->adapter->dev_set_bus(dev, 0); |
259 |
+ if (err) |
260 |
+- goto lbl_unregister_candev; |
261 |
++ goto adap_dev_free; |
262 |
+ } |
263 |
+ |
264 |
+ /* get device number early */ |
265 |
+@@ -894,6 +894,10 @@ static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter, |
266 |
+ |
267 |
+ return 0; |
268 |
+ |
269 |
++adap_dev_free: |
270 |
++ if (dev->adapter->dev_free) |
271 |
++ dev->adapter->dev_free(dev); |
272 |
++ |
273 |
+ lbl_unregister_candev: |
274 |
+ unregister_candev(netdev); |
275 |
+ |
276 |
+diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c |
277 |
+index bc00fa5e864f3..fb135797688a2 100644 |
278 |
+--- a/drivers/net/ethernet/freescale/gianfar.c |
279 |
++++ b/drivers/net/ethernet/freescale/gianfar.c |
280 |
+@@ -485,7 +485,11 @@ static struct net_device_stats *gfar_get_stats(struct net_device *dev) |
281 |
+ |
282 |
+ static int gfar_set_mac_addr(struct net_device *dev, void *p) |
283 |
+ { |
284 |
+- eth_mac_addr(dev, p); |
285 |
++ int ret; |
286 |
++ |
287 |
++ ret = eth_mac_addr(dev, p); |
288 |
++ if (ret) |
289 |
++ return ret; |
290 |
+ |
291 |
+ gfar_set_mac_for_addr(dev, 0, dev->dev_addr); |
292 |
+ |
293 |
+diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c |
294 |
+index d5e0e2aedc557..9b3ab60c35566 100644 |
295 |
+--- a/drivers/net/ieee802154/atusb.c |
296 |
++++ b/drivers/net/ieee802154/atusb.c |
297 |
+@@ -340,6 +340,7 @@ static int atusb_alloc_urbs(struct atusb *atusb, int n) |
298 |
+ return -ENOMEM; |
299 |
+ } |
300 |
+ usb_anchor_urb(urb, &atusb->idle_urbs); |
301 |
++ usb_free_urb(urb); |
302 |
+ n--; |
303 |
+ } |
304 |
+ return 0; |
305 |
+diff --git a/drivers/net/tun.c b/drivers/net/tun.c |
306 |
+index 2b7a3631b8824..7622f390ef1a7 100644 |
307 |
+--- a/drivers/net/tun.c |
308 |
++++ b/drivers/net/tun.c |
309 |
+@@ -71,6 +71,14 @@ |
310 |
+ #include <net/sock.h> |
311 |
+ #include <linux/seq_file.h> |
312 |
+ #include <linux/uio.h> |
313 |
++#include <linux/ieee802154.h> |
314 |
++#include <linux/if_ltalk.h> |
315 |
++#include <uapi/linux/if_fddi.h> |
316 |
++#include <uapi/linux/if_hippi.h> |
317 |
++#include <uapi/linux/if_fc.h> |
318 |
++#include <net/ax25.h> |
319 |
++#include <net/rose.h> |
320 |
++#include <net/6lowpan.h> |
321 |
+ |
322 |
+ #include <asm/uaccess.h> |
323 |
+ |
324 |
+@@ -1888,6 +1896,45 @@ unlock: |
325 |
+ return ret; |
326 |
+ } |
327 |
+ |
328 |
++/* Return correct value for tun->dev->addr_len based on tun->dev->type. */ |
329 |
++static unsigned char tun_get_addr_len(unsigned short type) |
330 |
++{ |
331 |
++ switch (type) { |
332 |
++ case ARPHRD_IP6GRE: |
333 |
++ case ARPHRD_TUNNEL6: |
334 |
++ return sizeof(struct in6_addr); |
335 |
++ case ARPHRD_IPGRE: |
336 |
++ case ARPHRD_TUNNEL: |
337 |
++ case ARPHRD_SIT: |
338 |
++ return 4; |
339 |
++ case ARPHRD_ETHER: |
340 |
++ return ETH_ALEN; |
341 |
++ case ARPHRD_IEEE802154: |
342 |
++ case ARPHRD_IEEE802154_MONITOR: |
343 |
++ return IEEE802154_EXTENDED_ADDR_LEN; |
344 |
++ case ARPHRD_PHONET_PIPE: |
345 |
++ case ARPHRD_PPP: |
346 |
++ case ARPHRD_NONE: |
347 |
++ return 0; |
348 |
++ case ARPHRD_6LOWPAN: |
349 |
++ return EUI64_ADDR_LEN; |
350 |
++ case ARPHRD_FDDI: |
351 |
++ return FDDI_K_ALEN; |
352 |
++ case ARPHRD_HIPPI: |
353 |
++ return HIPPI_ALEN; |
354 |
++ case ARPHRD_IEEE802: |
355 |
++ return FC_ALEN; |
356 |
++ case ARPHRD_ROSE: |
357 |
++ return ROSE_ADDR_LEN; |
358 |
++ case ARPHRD_NETROM: |
359 |
++ return AX25_ADDR_LEN; |
360 |
++ case ARPHRD_LOCALTLK: |
361 |
++ return LTALK_ALEN; |
362 |
++ default: |
363 |
++ return 0; |
364 |
++ } |
365 |
++} |
366 |
++ |
367 |
+ static long __tun_chr_ioctl(struct file *file, unsigned int cmd, |
368 |
+ unsigned long arg, int ifreq_len) |
369 |
+ { |
370 |
+@@ -2026,6 +2073,7 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd, |
371 |
+ ret = -EBUSY; |
372 |
+ } else { |
373 |
+ tun->dev->type = (int) arg; |
374 |
++ tun->dev->addr_len = tun_get_addr_len(tun->dev->type); |
375 |
+ tun_debug(KERN_INFO, tun, "linktype set to %d\n", |
376 |
+ tun->dev->type); |
377 |
+ ret = 0; |
378 |
+diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c |
379 |
+index d1e68b4835953..56bf952de411d 100644 |
380 |
+--- a/drivers/xen/events/events_base.c |
381 |
++++ b/drivers/xen/events/events_base.c |
382 |
+@@ -222,7 +222,7 @@ static int xen_irq_info_common_setup(struct irq_info *info, |
383 |
+ info->evtchn = evtchn; |
384 |
+ info->cpu = cpu; |
385 |
+ info->mask_reason = EVT_MASK_REASON_EXPLICIT; |
386 |
+- spin_lock_init(&info->lock); |
387 |
++ raw_spin_lock_init(&info->lock); |
388 |
+ |
389 |
+ ret = set_evtchn_to_irq(evtchn, irq); |
390 |
+ if (ret < 0) |
391 |
+@@ -374,28 +374,28 @@ static void do_mask(struct irq_info *info, u8 reason) |
392 |
+ { |
393 |
+ unsigned long flags; |
394 |
+ |
395 |
+- spin_lock_irqsave(&info->lock, flags); |
396 |
++ raw_spin_lock_irqsave(&info->lock, flags); |
397 |
+ |
398 |
+ if (!info->mask_reason) |
399 |
+ mask_evtchn(info->evtchn); |
400 |
+ |
401 |
+ info->mask_reason |= reason; |
402 |
+ |
403 |
+- spin_unlock_irqrestore(&info->lock, flags); |
404 |
++ raw_spin_unlock_irqrestore(&info->lock, flags); |
405 |
+ } |
406 |
+ |
407 |
+ static void do_unmask(struct irq_info *info, u8 reason) |
408 |
+ { |
409 |
+ unsigned long flags; |
410 |
+ |
411 |
+- spin_lock_irqsave(&info->lock, flags); |
412 |
++ raw_spin_lock_irqsave(&info->lock, flags); |
413 |
+ |
414 |
+ info->mask_reason &= ~reason; |
415 |
+ |
416 |
+ if (!info->mask_reason) |
417 |
+ unmask_evtchn(info->evtchn); |
418 |
+ |
419 |
+- spin_unlock_irqrestore(&info->lock, flags); |
420 |
++ raw_spin_unlock_irqrestore(&info->lock, flags); |
421 |
+ } |
422 |
+ |
423 |
+ #ifdef CONFIG_X86 |
424 |
+@@ -1779,7 +1779,7 @@ static void lateeoi_ack_dynirq(struct irq_data *data) |
425 |
+ |
426 |
+ if (VALID_EVTCHN(evtchn)) { |
427 |
+ do_mask(info, EVT_MASK_REASON_EOI_PENDING); |
428 |
+- event_handler_exit(info); |
429 |
++ ack_dynirq(data); |
430 |
+ } |
431 |
+ } |
432 |
+ |
433 |
+@@ -1790,7 +1790,7 @@ static void lateeoi_mask_ack_dynirq(struct irq_data *data) |
434 |
+ |
435 |
+ if (VALID_EVTCHN(evtchn)) { |
436 |
+ do_mask(info, EVT_MASK_REASON_EXPLICIT); |
437 |
+- event_handler_exit(info); |
438 |
++ ack_dynirq(data); |
439 |
+ } |
440 |
+ } |
441 |
+ |
442 |
+diff --git a/drivers/xen/events/events_internal.h b/drivers/xen/events/events_internal.h |
443 |
+index 3df6f28b75e69..cc37b711491ce 100644 |
444 |
+--- a/drivers/xen/events/events_internal.h |
445 |
++++ b/drivers/xen/events/events_internal.h |
446 |
+@@ -47,7 +47,7 @@ struct irq_info { |
447 |
+ unsigned short eoi_cpu; /* EOI must happen on this cpu */ |
448 |
+ unsigned int irq_epoch; /* If eoi_cpu valid: irq_epoch of event */ |
449 |
+ u64 eoi_time; /* Time in jiffies when to EOI. */ |
450 |
+- spinlock_t lock; |
451 |
++ raw_spinlock_t lock; |
452 |
+ |
453 |
+ union { |
454 |
+ unsigned short virq; |
455 |
+diff --git a/fs/direct-io.c b/fs/direct-io.c |
456 |
+index 44f49d86d714a..49c06f3cd952a 100644 |
457 |
+--- a/fs/direct-io.c |
458 |
++++ b/fs/direct-io.c |
459 |
+@@ -780,6 +780,7 @@ submit_page_section(struct dio *dio, struct dio_submit *sdio, struct page *page, |
460 |
+ struct buffer_head *map_bh) |
461 |
+ { |
462 |
+ int ret = 0; |
463 |
++ int boundary = sdio->boundary; /* dio_send_cur_page may clear it */ |
464 |
+ |
465 |
+ if (dio->rw & WRITE) { |
466 |
+ /* |
467 |
+@@ -818,10 +819,10 @@ submit_page_section(struct dio *dio, struct dio_submit *sdio, struct page *page, |
468 |
+ sdio->cur_page_fs_offset = sdio->block_in_file << sdio->blkbits; |
469 |
+ out: |
470 |
+ /* |
471 |
+- * If sdio->boundary then we want to schedule the IO now to |
472 |
++ * If boundary then we want to schedule the IO now to |
473 |
+ * avoid metadata seeks. |
474 |
+ */ |
475 |
+- if (sdio->boundary) { |
476 |
++ if (boundary) { |
477 |
+ ret = dio_send_cur_page(dio, sdio, map_bh); |
478 |
+ if (sdio->bio) |
479 |
+ dio_bio_submit(dio, sdio); |
480 |
+diff --git a/include/net/red.h b/include/net/red.h |
481 |
+index b3ab5c6bfa83f..117a3654d3194 100644 |
482 |
+--- a/include/net/red.h |
483 |
++++ b/include/net/red.h |
484 |
+@@ -170,9 +170,9 @@ static inline void red_set_vars(struct red_vars *v) |
485 |
+ static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog, |
486 |
+ u8 Scell_log, u8 *stab) |
487 |
+ { |
488 |
+- if (fls(qth_min) + Wlog > 32) |
489 |
++ if (fls(qth_min) + Wlog >= 32) |
490 |
+ return false; |
491 |
+- if (fls(qth_max) + Wlog > 32) |
492 |
++ if (fls(qth_max) + Wlog >= 32) |
493 |
+ return false; |
494 |
+ if (Scell_log >= 32) |
495 |
+ return false; |
496 |
+diff --git a/kernel/workqueue.c b/kernel/workqueue.c |
497 |
+index 6b293804cd734..a2de597604e68 100644 |
498 |
+--- a/kernel/workqueue.c |
499 |
++++ b/kernel/workqueue.c |
500 |
+@@ -1351,7 +1351,6 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, |
501 |
+ */ |
502 |
+ WARN_ON_ONCE(!irqs_disabled()); |
503 |
+ |
504 |
+- debug_work_activate(work); |
505 |
+ |
506 |
+ /* if draining, only works from the same workqueue are allowed */ |
507 |
+ if (unlikely(wq->flags & __WQ_DRAINING) && |
508 |
+@@ -1430,6 +1429,7 @@ retry: |
509 |
+ worklist = &pwq->delayed_works; |
510 |
+ } |
511 |
+ |
512 |
++ debug_work_activate(work); |
513 |
+ insert_work(pwq, work, worklist, work_flags); |
514 |
+ |
515 |
+ spin_unlock(&pwq->pool->lock); |
516 |
+diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c |
517 |
+index 06f366d234ffb..5f976485e8c64 100644 |
518 |
+--- a/net/batman-adv/translation-table.c |
519 |
++++ b/net/batman-adv/translation-table.c |
520 |
+@@ -871,6 +871,7 @@ batadv_tt_prepare_tvlv_local_data(struct batadv_priv *bat_priv, |
521 |
+ |
522 |
+ tt_vlan->vid = htons(vlan->vid); |
523 |
+ tt_vlan->crc = htonl(vlan->tt.crc); |
524 |
++ tt_vlan->reserved = 0; |
525 |
+ |
526 |
+ tt_vlan++; |
527 |
+ } |
528 |
+diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c |
529 |
+index 3503c38954f9f..76691a07a2e08 100644 |
530 |
+--- a/net/ieee802154/nl-mac.c |
531 |
++++ b/net/ieee802154/nl-mac.c |
532 |
+@@ -557,9 +557,7 @@ ieee802154_llsec_parse_key_id(struct genl_info *info, |
533 |
+ desc->mode = nla_get_u8(info->attrs[IEEE802154_ATTR_LLSEC_KEY_MODE]); |
534 |
+ |
535 |
+ if (desc->mode == IEEE802154_SCF_KEY_IMPLICIT) { |
536 |
+- if (!info->attrs[IEEE802154_ATTR_PAN_ID] && |
537 |
+- !(info->attrs[IEEE802154_ATTR_SHORT_ADDR] || |
538 |
+- info->attrs[IEEE802154_ATTR_HW_ADDR])) |
539 |
++ if (!info->attrs[IEEE802154_ATTR_PAN_ID]) |
540 |
+ return -EINVAL; |
541 |
+ |
542 |
+ desc->device_addr.pan_id = nla_get_shortaddr(info->attrs[IEEE802154_ATTR_PAN_ID]); |
543 |
+@@ -568,6 +566,9 @@ ieee802154_llsec_parse_key_id(struct genl_info *info, |
544 |
+ desc->device_addr.mode = IEEE802154_ADDR_SHORT; |
545 |
+ desc->device_addr.short_addr = nla_get_shortaddr(info->attrs[IEEE802154_ATTR_SHORT_ADDR]); |
546 |
+ } else { |
547 |
++ if (!info->attrs[IEEE802154_ATTR_HW_ADDR]) |
548 |
++ return -EINVAL; |
549 |
++ |
550 |
+ desc->device_addr.mode = IEEE802154_ADDR_LONG; |
551 |
+ desc->device_addr.extended_addr = nla_get_hwaddr(info->attrs[IEEE802154_ATTR_HW_ADDR]); |
552 |
+ } |
553 |
+diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c |
554 |
+index 16ef0d9f566e8..c23c08f49c3c3 100644 |
555 |
+--- a/net/ieee802154/nl802154.c |
556 |
++++ b/net/ieee802154/nl802154.c |
557 |
+@@ -843,8 +843,13 @@ nl802154_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flags, |
558 |
+ goto nla_put_failure; |
559 |
+ |
560 |
+ #ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL |
561 |
++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) |
562 |
++ goto out; |
563 |
++ |
564 |
+ if (nl802154_get_llsec_params(msg, rdev, wpan_dev) < 0) |
565 |
+ goto nla_put_failure; |
566 |
++ |
567 |
++out: |
568 |
+ #endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */ |
569 |
+ |
570 |
+ genlmsg_end(msg, hdr); |
571 |
+@@ -1367,6 +1372,9 @@ static int nl802154_set_llsec_params(struct sk_buff *skb, |
572 |
+ u32 changed = 0; |
573 |
+ int ret; |
574 |
+ |
575 |
++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) |
576 |
++ return -EOPNOTSUPP; |
577 |
++ |
578 |
+ if (info->attrs[NL802154_ATTR_SEC_ENABLED]) { |
579 |
+ u8 enabled; |
580 |
+ |
581 |
+@@ -1527,7 +1535,8 @@ static int nl802154_add_llsec_key(struct sk_buff *skb, struct genl_info *info) |
582 |
+ struct ieee802154_llsec_key_id id = { }; |
583 |
+ u32 commands[NL802154_CMD_FRAME_NR_IDS / 32] = { }; |
584 |
+ |
585 |
+- if (nla_parse_nested(attrs, NL802154_KEY_ATTR_MAX, |
586 |
++ if (!info->attrs[NL802154_ATTR_SEC_KEY] || |
587 |
++ nla_parse_nested(attrs, NL802154_KEY_ATTR_MAX, |
588 |
+ info->attrs[NL802154_ATTR_SEC_KEY], |
589 |
+ nl802154_key_policy)) |
590 |
+ return -EINVAL; |
591 |
+@@ -1577,7 +1586,8 @@ static int nl802154_del_llsec_key(struct sk_buff *skb, struct genl_info *info) |
592 |
+ struct nlattr *attrs[NL802154_KEY_ATTR_MAX + 1]; |
593 |
+ struct ieee802154_llsec_key_id id; |
594 |
+ |
595 |
+- if (nla_parse_nested(attrs, NL802154_KEY_ATTR_MAX, |
596 |
++ if (!info->attrs[NL802154_ATTR_SEC_KEY] || |
597 |
++ nla_parse_nested(attrs, NL802154_KEY_ATTR_MAX, |
598 |
+ info->attrs[NL802154_ATTR_SEC_KEY], |
599 |
+ nl802154_key_policy)) |
600 |
+ return -EINVAL; |
601 |
+@@ -1745,7 +1755,8 @@ static int nl802154_del_llsec_dev(struct sk_buff *skb, struct genl_info *info) |
602 |
+ struct nlattr *attrs[NL802154_DEV_ATTR_MAX + 1]; |
603 |
+ __le64 extended_addr; |
604 |
+ |
605 |
+- if (nla_parse_nested(attrs, NL802154_DEV_ATTR_MAX, |
606 |
++ if (!info->attrs[NL802154_ATTR_SEC_DEVICE] || |
607 |
++ nla_parse_nested(attrs, NL802154_DEV_ATTR_MAX, |
608 |
+ info->attrs[NL802154_ATTR_SEC_DEVICE], |
609 |
+ nl802154_dev_policy)) |
610 |
+ return -EINVAL; |
611 |
+@@ -1905,7 +1916,8 @@ static int nl802154_del_llsec_devkey(struct sk_buff *skb, struct genl_info *info |
612 |
+ struct ieee802154_llsec_device_key key; |
613 |
+ __le64 extended_addr; |
614 |
+ |
615 |
+- if (nla_parse_nested(attrs, NL802154_DEVKEY_ATTR_MAX, |
616 |
++ if (!info->attrs[NL802154_ATTR_SEC_DEVKEY] || |
617 |
++ nla_parse_nested(attrs, NL802154_DEVKEY_ATTR_MAX, |
618 |
+ info->attrs[NL802154_ATTR_SEC_DEVKEY], |
619 |
+ nl802154_devkey_policy)) |
620 |
+ return -EINVAL; |
621 |
+@@ -2080,6 +2092,9 @@ static int nl802154_del_llsec_seclevel(struct sk_buff *skb, |
622 |
+ struct wpan_dev *wpan_dev = dev->ieee802154_ptr; |
623 |
+ struct ieee802154_llsec_seclevel sl; |
624 |
+ |
625 |
++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) |
626 |
++ return -EOPNOTSUPP; |
627 |
++ |
628 |
+ if (!info->attrs[NL802154_ATTR_SEC_LEVEL] || |
629 |
+ llsec_parse_seclevel(info->attrs[NL802154_ATTR_SEC_LEVEL], |
630 |
+ &sl) < 0) |
631 |
+diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c |
632 |
+index 574697326ebc9..ea164fd61a7c6 100644 |
633 |
+--- a/net/ipv4/netfilter/arp_tables.c |
634 |
++++ b/net/ipv4/netfilter/arp_tables.c |
635 |
+@@ -1349,6 +1349,8 @@ static int translate_compat_table(struct net *net, |
636 |
+ if (!newinfo) |
637 |
+ goto out_unlock; |
638 |
+ |
639 |
++ memset(newinfo->entries, 0, size); |
640 |
++ |
641 |
+ newinfo->number = compatr->num_entries; |
642 |
+ for (i = 0; i < NF_ARP_NUMHOOKS; i++) { |
643 |
+ newinfo->hook_entry[i] = compatr->hook_entry[i]; |
644 |
+diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c |
645 |
+index 53d664a7774c4..684003063174d 100644 |
646 |
+--- a/net/ipv4/netfilter/ip_tables.c |
647 |
++++ b/net/ipv4/netfilter/ip_tables.c |
648 |
+@@ -1610,6 +1610,8 @@ translate_compat_table(struct net *net, |
649 |
+ if (!newinfo) |
650 |
+ goto out_unlock; |
651 |
+ |
652 |
++ memset(newinfo->entries, 0, size); |
653 |
++ |
654 |
+ newinfo->number = compatr->num_entries; |
655 |
+ for (i = 0; i < NF_INET_NUMHOOKS; i++) { |
656 |
+ newinfo->hook_entry[i] = compatr->hook_entry[i]; |
657 |
+diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c |
658 |
+index f563cf3fcc4c3..3057356cfdff5 100644 |
659 |
+--- a/net/ipv6/netfilter/ip6_tables.c |
660 |
++++ b/net/ipv6/netfilter/ip6_tables.c |
661 |
+@@ -1617,6 +1617,8 @@ translate_compat_table(struct net *net, |
662 |
+ if (!newinfo) |
663 |
+ goto out_unlock; |
664 |
+ |
665 |
++ memset(newinfo->entries, 0, size); |
666 |
++ |
667 |
+ newinfo->number = compatr->num_entries; |
668 |
+ for (i = 0; i < NF_INET_NUMHOOKS; i++) { |
669 |
+ newinfo->hook_entry[i] = compatr->hook_entry[i]; |
670 |
+diff --git a/net/ipv6/route.c b/net/ipv6/route.c |
671 |
+index 50eba77f5a0d2..f06a768787460 100644 |
672 |
+--- a/net/ipv6/route.c |
673 |
++++ b/net/ipv6/route.c |
674 |
+@@ -2980,9 +2980,11 @@ static int ip6_route_multipath_add(struct fib6_config *cfg) |
675 |
+ * nexthops have been replaced by first new, the rest should |
676 |
+ * be added to it. |
677 |
+ */ |
678 |
+- cfg->fc_nlinfo.nlh->nlmsg_flags &= ~(NLM_F_EXCL | |
679 |
+- NLM_F_REPLACE); |
680 |
+- cfg->fc_nlinfo.nlh->nlmsg_flags |= NLM_F_CREATE; |
681 |
++ if (cfg->fc_nlinfo.nlh) { |
682 |
++ cfg->fc_nlinfo.nlh->nlmsg_flags &= ~(NLM_F_EXCL | |
683 |
++ NLM_F_REPLACE); |
684 |
++ cfg->fc_nlinfo.nlh->nlmsg_flags |= NLM_F_CREATE; |
685 |
++ } |
686 |
+ nhn++; |
687 |
+ } |
688 |
+ |
689 |
+diff --git a/net/mac802154/llsec.c b/net/mac802154/llsec.c |
690 |
+index a13d02b7cee47..55ed8a97b33fa 100644 |
691 |
+--- a/net/mac802154/llsec.c |
692 |
++++ b/net/mac802154/llsec.c |
693 |
+@@ -158,7 +158,7 @@ err_tfm0: |
694 |
+ crypto_free_blkcipher(key->tfm0); |
695 |
+ err_tfm: |
696 |
+ for (i = 0; i < ARRAY_SIZE(key->tfm); i++) |
697 |
+- if (key->tfm[i]) |
698 |
++ if (!IS_ERR_OR_NULL(key->tfm[i])) |
699 |
+ crypto_free_aead(key->tfm[i]); |
700 |
+ |
701 |
+ kzfree(key); |
702 |
+diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c |
703 |
+index 8caae1c5d93df..7e261fab7ef8d 100644 |
704 |
+--- a/net/netfilter/x_tables.c |
705 |
++++ b/net/netfilter/x_tables.c |
706 |
+@@ -568,7 +568,7 @@ void xt_compat_match_from_user(struct xt_entry_match *m, void **dstptr, |
707 |
+ { |
708 |
+ const struct xt_match *match = m->u.kernel.match; |
709 |
+ struct compat_xt_entry_match *cm = (struct compat_xt_entry_match *)m; |
710 |
+- int pad, off = xt_compat_match_offset(match); |
711 |
++ int off = xt_compat_match_offset(match); |
712 |
+ u_int16_t msize = cm->u.user.match_size; |
713 |
+ char name[sizeof(m->u.user.name)]; |
714 |
+ |
715 |
+@@ -578,9 +578,6 @@ void xt_compat_match_from_user(struct xt_entry_match *m, void **dstptr, |
716 |
+ match->compat_from_user(m->data, cm->data); |
717 |
+ else |
718 |
+ memcpy(m->data, cm->data, msize - sizeof(*cm)); |
719 |
+- pad = XT_ALIGN(match->matchsize) - match->matchsize; |
720 |
+- if (pad > 0) |
721 |
+- memset(m->data + match->matchsize, 0, pad); |
722 |
+ |
723 |
+ msize += off; |
724 |
+ m->u.user.match_size = msize; |
725 |
+@@ -926,7 +923,7 @@ void xt_compat_target_from_user(struct xt_entry_target *t, void **dstptr, |
726 |
+ { |
727 |
+ const struct xt_target *target = t->u.kernel.target; |
728 |
+ struct compat_xt_entry_target *ct = (struct compat_xt_entry_target *)t; |
729 |
+- int pad, off = xt_compat_target_offset(target); |
730 |
++ int off = xt_compat_target_offset(target); |
731 |
+ u_int16_t tsize = ct->u.user.target_size; |
732 |
+ char name[sizeof(t->u.user.name)]; |
733 |
+ |
734 |
+@@ -936,9 +933,6 @@ void xt_compat_target_from_user(struct xt_entry_target *t, void **dstptr, |
735 |
+ target->compat_from_user(t->data, ct->data); |
736 |
+ else |
737 |
+ memcpy(t->data, ct->data, tsize - sizeof(*ct)); |
738 |
+- pad = XT_ALIGN(target->targetsize) - target->targetsize; |
739 |
+- if (pad > 0) |
740 |
+- memset(t->data + target->targetsize, 0, pad); |
741 |
+ |
742 |
+ tsize += off; |
743 |
+ t->u.user.target_size = tsize; |
744 |
+diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c |
745 |
+index 44d6b8355eab7..2f8d38d0802ac 100644 |
746 |
+--- a/net/nfc/llcp_sock.c |
747 |
++++ b/net/nfc/llcp_sock.c |
748 |
+@@ -119,11 +119,13 @@ static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen) |
749 |
+ llcp_sock->service_name_len, |
750 |
+ GFP_KERNEL); |
751 |
+ if (!llcp_sock->service_name) { |
752 |
++ nfc_llcp_local_put(llcp_sock->local); |
753 |
+ ret = -ENOMEM; |
754 |
+ goto put_dev; |
755 |
+ } |
756 |
+ llcp_sock->ssap = nfc_llcp_get_sdp_ssap(local, llcp_sock); |
757 |
+ if (llcp_sock->ssap == LLCP_SAP_MAX) { |
758 |
++ nfc_llcp_local_put(llcp_sock->local); |
759 |
+ kfree(llcp_sock->service_name); |
760 |
+ llcp_sock->service_name = NULL; |
761 |
+ ret = -EADDRINUSE; |
762 |
+@@ -677,6 +679,10 @@ static int llcp_sock_connect(struct socket *sock, struct sockaddr *_addr, |
763 |
+ ret = -EISCONN; |
764 |
+ goto error; |
765 |
+ } |
766 |
++ if (sk->sk_state == LLCP_CONNECTING) { |
767 |
++ ret = -EINPROGRESS; |
768 |
++ goto error; |
769 |
++ } |
770 |
+ |
771 |
+ dev = nfc_get_device(addr->dev_idx); |
772 |
+ if (dev == NULL) { |
773 |
+@@ -708,6 +714,7 @@ static int llcp_sock_connect(struct socket *sock, struct sockaddr *_addr, |
774 |
+ llcp_sock->local = nfc_llcp_local_get(local); |
775 |
+ llcp_sock->ssap = nfc_llcp_get_local_ssap(local); |
776 |
+ if (llcp_sock->ssap == LLCP_SAP_MAX) { |
777 |
++ nfc_llcp_local_put(llcp_sock->local); |
778 |
+ ret = -ENOMEM; |
779 |
+ goto put_dev; |
780 |
+ } |
781 |
+@@ -745,8 +752,11 @@ static int llcp_sock_connect(struct socket *sock, struct sockaddr *_addr, |
782 |
+ |
783 |
+ sock_unlink: |
784 |
+ nfc_llcp_put_ssap(local, llcp_sock->ssap); |
785 |
++ nfc_llcp_local_put(llcp_sock->local); |
786 |
+ |
787 |
+ nfc_llcp_sock_unlink(&local->connecting_sockets, sk); |
788 |
++ kfree(llcp_sock->service_name); |
789 |
++ llcp_sock->service_name = NULL; |
790 |
+ |
791 |
+ put_dev: |
792 |
+ nfc_put_device(dev); |
793 |
+diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c |
794 |
+index e02687185a594..a7ecf626e9982 100644 |
795 |
+--- a/net/sched/sch_teql.c |
796 |
++++ b/net/sched/sch_teql.c |
797 |
+@@ -138,6 +138,9 @@ teql_destroy(struct Qdisc *sch) |
798 |
+ struct teql_sched_data *dat = qdisc_priv(sch); |
799 |
+ struct teql_master *master = dat->m; |
800 |
+ |
801 |
++ if (!master) |
802 |
++ return; |
803 |
++ |
804 |
+ prev = master->slaves; |
805 |
+ if (prev) { |
806 |
+ do { |
807 |
+diff --git a/net/tipc/socket.c b/net/tipc/socket.c |
808 |
+index 65171f8e8c45a..0e5bb03c64254 100644 |
809 |
+--- a/net/tipc/socket.c |
810 |
++++ b/net/tipc/socket.c |
811 |
+@@ -763,7 +763,7 @@ void tipc_sk_mcast_rcv(struct net *net, struct sk_buff_head *arrvq, |
812 |
+ spin_lock_bh(&inputq->lock); |
813 |
+ if (skb_peek(arrvq) == skb) { |
814 |
+ skb_queue_splice_tail_init(&tmpq, inputq); |
815 |
+- kfree_skb(__skb_dequeue(arrvq)); |
816 |
++ __skb_dequeue(arrvq); |
817 |
+ } |
818 |
+ spin_unlock_bh(&inputq->lock); |
819 |
+ __skb_queue_purge(&tmpq); |
820 |
+diff --git a/net/wireless/sme.c b/net/wireless/sme.c |
821 |
+index 18b4a652cf41f..784f1ee24e596 100644 |
822 |
+--- a/net/wireless/sme.c |
823 |
++++ b/net/wireless/sme.c |
824 |
+@@ -507,7 +507,7 @@ static int cfg80211_sme_connect(struct wireless_dev *wdev, |
825 |
+ if (wdev->current_bss) |
826 |
+ return -EALREADY; |
827 |
+ |
828 |
+- if (WARN_ON(wdev->conn)) |
829 |
++ if (wdev->conn) |
830 |
+ return -EINPROGRESS; |
831 |
+ |
832 |
+ wdev->conn = kzalloc(sizeof(*wdev->conn), GFP_KERNEL); |
833 |
+diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c |
834 |
+index 847f70348d4d5..cc600aa0f6c78 100644 |
835 |
+--- a/sound/drivers/aloop.c |
836 |
++++ b/sound/drivers/aloop.c |
837 |
+@@ -1062,6 +1062,14 @@ static int loopback_mixer_new(struct loopback *loopback, int notify) |
838 |
+ return -ENOMEM; |
839 |
+ kctl->id.device = dev; |
840 |
+ kctl->id.subdevice = substr; |
841 |
++ |
842 |
++ /* Add the control before copying the id so that |
843 |
++ * the numid field of the id is set in the copy. |
844 |
++ */ |
845 |
++ err = snd_ctl_add(card, kctl); |
846 |
++ if (err < 0) |
847 |
++ return err; |
848 |
++ |
849 |
+ switch (idx) { |
850 |
+ case ACTIVE_IDX: |
851 |
+ setup->active_id = kctl->id; |
852 |
+@@ -1078,9 +1086,6 @@ static int loopback_mixer_new(struct loopback *loopback, int notify) |
853 |
+ default: |
854 |
+ break; |
855 |
+ } |
856 |
+- err = snd_ctl_add(card, kctl); |
857 |
+- if (err < 0) |
858 |
+- return err; |
859 |
+ } |
860 |
+ } |
861 |
+ } |
862 |
+diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c |
863 |
+index 2a51212d5e499..e86fd1b38448e 100644 |
864 |
+--- a/tools/perf/util/map.c |
865 |
++++ b/tools/perf/util/map.c |
866 |
+@@ -88,8 +88,7 @@ static inline bool replace_android_lib(const char *filename, char *newfilename) |
867 |
+ if (!strncmp(filename, "/system/lib/", 12)) { |
868 |
+ char *ndk, *app; |
869 |
+ const char *arch; |
870 |
+- size_t ndk_length; |
871 |
+- size_t app_length; |
872 |
++ int ndk_length, app_length; |
873 |
+ |
874 |
+ ndk = getenv("NDK_ROOT"); |
875 |
+ app = getenv("APP_PLATFORM"); |
876 |
+@@ -117,8 +116,8 @@ static inline bool replace_android_lib(const char *filename, char *newfilename) |
877 |
+ if (new_length > PATH_MAX) |
878 |
+ return false; |
879 |
+ snprintf(newfilename, new_length, |
880 |
+- "%s/platforms/%s/arch-%s/usr/lib/%s", |
881 |
+- ndk, app, arch, libname); |
882 |
++ "%.*s/platforms/%.*s/arch-%s/usr/lib/%s", |
883 |
++ ndk_length, ndk, app_length, app, arch, libname); |
884 |
+ |
885 |
+ return true; |
886 |
+ } |