Contents of /trunk/kernel-alx/patches-5.4/0277-5.4.178-all-fixes.patch
Parent Directory | Revision Log
Revision 3637 -
(show annotations)
(download)
Mon Oct 24 12:40:44 2022 UTC (18 months ago) by niro
File size: 41532 byte(s)
Mon Oct 24 12:40:44 2022 UTC (18 months ago) by niro
File size: 41532 byte(s)
-add missing
1 | diff --git a/Makefile b/Makefile |
2 | index 324939b64d7b7..6d33284664fef 100644 |
3 | --- a/Makefile |
4 | +++ b/Makefile |
5 | @@ -1,7 +1,7 @@ |
6 | # SPDX-License-Identifier: GPL-2.0 |
7 | VERSION = 5 |
8 | PATCHLEVEL = 4 |
9 | -SUBLEVEL = 177 |
10 | +SUBLEVEL = 178 |
11 | EXTRAVERSION = |
12 | NAME = Kleptomaniac Octopus |
13 | |
14 | diff --git a/block/bio-integrity.c b/block/bio-integrity.c |
15 | index c9dc2b17ce251..ec295be93ca0d 100644 |
16 | --- a/block/bio-integrity.c |
17 | +++ b/block/bio-integrity.c |
18 | @@ -380,7 +380,7 @@ void bio_integrity_advance(struct bio *bio, unsigned int bytes_done) |
19 | struct blk_integrity *bi = blk_get_integrity(bio->bi_disk); |
20 | unsigned bytes = bio_integrity_bytes(bi, bytes_done >> 9); |
21 | |
22 | - bip->bip_iter.bi_sector += bytes_done >> 9; |
23 | + bip->bip_iter.bi_sector += bio_integrity_intervals(bi, bytes_done >> 9); |
24 | bvec_iter_advance(bip->bip_vec, &bip->bip_iter, bytes); |
25 | } |
26 | |
27 | diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c |
28 | index 0be3d1b17f034..a09a5041e74c8 100644 |
29 | --- a/drivers/edac/altera_edac.c |
30 | +++ b/drivers/edac/altera_edac.c |
31 | @@ -349,7 +349,7 @@ static int altr_sdram_probe(struct platform_device *pdev) |
32 | if (irq < 0) { |
33 | edac_printk(KERN_ERR, EDAC_MC, |
34 | "No irq %d in DT\n", irq); |
35 | - return -ENODEV; |
36 | + return irq; |
37 | } |
38 | |
39 | /* Arria10 has a 2nd IRQ */ |
40 | diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c |
41 | index e4a1032ba0b58..cd9926e518967 100644 |
42 | --- a/drivers/edac/xgene_edac.c |
43 | +++ b/drivers/edac/xgene_edac.c |
44 | @@ -1922,7 +1922,7 @@ static int xgene_edac_probe(struct platform_device *pdev) |
45 | irq = platform_get_irq(pdev, i); |
46 | if (irq < 0) { |
47 | dev_err(&pdev->dev, "No IRQ resource\n"); |
48 | - rc = -EINVAL; |
49 | + rc = irq; |
50 | goto out_err; |
51 | } |
52 | rc = devm_request_irq(&pdev->dev, irq, |
53 | diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c |
54 | index 29edfc3437163..aeb7cb651fa4f 100644 |
55 | --- a/drivers/gpu/drm/i915/display/intel_overlay.c |
56 | +++ b/drivers/gpu/drm/i915/display/intel_overlay.c |
57 | @@ -913,6 +913,9 @@ static int check_overlay_dst(struct intel_overlay *overlay, |
58 | const struct intel_crtc_state *pipe_config = |
59 | overlay->crtc->config; |
60 | |
61 | + if (rec->dst_height == 0 || rec->dst_width == 0) |
62 | + return -EINVAL; |
63 | + |
64 | if (rec->dst_x < pipe_config->pipe_src_w && |
65 | rec->dst_x + rec->dst_width <= pipe_config->pipe_src_w && |
66 | rec->dst_y < pipe_config->pipe_src_h && |
67 | diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c |
68 | index f3c30b2a788e8..8bff14ae16b0e 100644 |
69 | --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c |
70 | +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c |
71 | @@ -38,7 +38,7 @@ nvbios_addr(struct nvkm_bios *bios, u32 *addr, u8 size) |
72 | *addr += bios->imaged_addr; |
73 | } |
74 | |
75 | - if (unlikely(*addr + size >= bios->size)) { |
76 | + if (unlikely(*addr + size > bios->size)) { |
77 | nvkm_error(&bios->subdev, "OOB %d %08x %08x\n", size, p, *addr); |
78 | return false; |
79 | } |
80 | diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c |
81 | index 48864269f042a..baa129a6c9127 100644 |
82 | --- a/drivers/infiniband/hw/mlx4/main.c |
83 | +++ b/drivers/infiniband/hw/mlx4/main.c |
84 | @@ -3291,7 +3291,7 @@ static void mlx4_ib_event(struct mlx4_dev *dev, void *ibdev_ptr, |
85 | case MLX4_DEV_EVENT_PORT_MGMT_CHANGE: |
86 | ew = kmalloc(sizeof *ew, GFP_ATOMIC); |
87 | if (!ew) |
88 | - break; |
89 | + return; |
90 | |
91 | INIT_WORK(&ew->work, handle_port_mgmt_change_event); |
92 | memcpy(&ew->ib_eqe, eqe, sizeof *eqe); |
93 | diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c |
94 | index d14ad523f96c8..a5152f097cb7a 100644 |
95 | --- a/drivers/infiniband/sw/rdmavt/qp.c |
96 | +++ b/drivers/infiniband/sw/rdmavt/qp.c |
97 | @@ -3110,6 +3110,8 @@ do_write: |
98 | case IB_WR_ATOMIC_FETCH_AND_ADD: |
99 | if (unlikely(!(qp->qp_access_flags & IB_ACCESS_REMOTE_ATOMIC))) |
100 | goto inv_err; |
101 | + if (unlikely(wqe->atomic_wr.remote_addr & (sizeof(u64) - 1))) |
102 | + goto inv_err; |
103 | if (unlikely(!rvt_rkey_ok(qp, &qp->r_sge.sge, sizeof(u64), |
104 | wqe->atomic_wr.remote_addr, |
105 | wqe->atomic_wr.rkey, |
106 | diff --git a/drivers/infiniband/sw/siw/siw.h b/drivers/infiniband/sw/siw/siw.h |
107 | index 4d8bc995b4503..eaa9863dd1e00 100644 |
108 | --- a/drivers/infiniband/sw/siw/siw.h |
109 | +++ b/drivers/infiniband/sw/siw/siw.h |
110 | @@ -658,14 +658,9 @@ static inline struct siw_sqe *orq_get_current(struct siw_qp *qp) |
111 | return &qp->orq[qp->orq_get % qp->attrs.orq_size]; |
112 | } |
113 | |
114 | -static inline struct siw_sqe *orq_get_tail(struct siw_qp *qp) |
115 | -{ |
116 | - return &qp->orq[qp->orq_put % qp->attrs.orq_size]; |
117 | -} |
118 | - |
119 | static inline struct siw_sqe *orq_get_free(struct siw_qp *qp) |
120 | { |
121 | - struct siw_sqe *orq_e = orq_get_tail(qp); |
122 | + struct siw_sqe *orq_e = &qp->orq[qp->orq_put % qp->attrs.orq_size]; |
123 | |
124 | if (READ_ONCE(orq_e->flags) == 0) |
125 | return orq_e; |
126 | diff --git a/drivers/infiniband/sw/siw/siw_qp_rx.c b/drivers/infiniband/sw/siw/siw_qp_rx.c |
127 | index c7c38f7fd29d6..5f94c716301fa 100644 |
128 | --- a/drivers/infiniband/sw/siw/siw_qp_rx.c |
129 | +++ b/drivers/infiniband/sw/siw/siw_qp_rx.c |
130 | @@ -1153,11 +1153,12 @@ static int siw_check_tx_fence(struct siw_qp *qp) |
131 | |
132 | spin_lock_irqsave(&qp->orq_lock, flags); |
133 | |
134 | - rreq = orq_get_current(qp); |
135 | - |
136 | /* free current orq entry */ |
137 | + rreq = orq_get_current(qp); |
138 | WRITE_ONCE(rreq->flags, 0); |
139 | |
140 | + qp->orq_get++; |
141 | + |
142 | if (qp->tx_ctx.orq_fence) { |
143 | if (unlikely(tx_waiting->wr_status != SIW_WR_QUEUED)) { |
144 | pr_warn("siw: [QP %u]: fence resume: bad status %d\n", |
145 | @@ -1165,10 +1166,12 @@ static int siw_check_tx_fence(struct siw_qp *qp) |
146 | rv = -EPROTO; |
147 | goto out; |
148 | } |
149 | - /* resume SQ processing */ |
150 | + /* resume SQ processing, if possible */ |
151 | if (tx_waiting->sqe.opcode == SIW_OP_READ || |
152 | tx_waiting->sqe.opcode == SIW_OP_READ_LOCAL_INV) { |
153 | - rreq = orq_get_tail(qp); |
154 | + |
155 | + /* SQ processing was stopped because of a full ORQ */ |
156 | + rreq = orq_get_free(qp); |
157 | if (unlikely(!rreq)) { |
158 | pr_warn("siw: [QP %u]: no ORQE\n", qp_id(qp)); |
159 | rv = -EPROTO; |
160 | @@ -1181,15 +1184,14 @@ static int siw_check_tx_fence(struct siw_qp *qp) |
161 | resume_tx = 1; |
162 | |
163 | } else if (siw_orq_empty(qp)) { |
164 | + /* |
165 | + * SQ processing was stopped by fenced work request. |
166 | + * Resume since all previous Read's are now completed. |
167 | + */ |
168 | qp->tx_ctx.orq_fence = 0; |
169 | resume_tx = 1; |
170 | - } else { |
171 | - pr_warn("siw: [QP %u]: fence resume: orq idx: %d:%d\n", |
172 | - qp_id(qp), qp->orq_get, qp->orq_put); |
173 | - rv = -EPROTO; |
174 | } |
175 | } |
176 | - qp->orq_get++; |
177 | out: |
178 | spin_unlock_irqrestore(&qp->orq_lock, flags); |
179 | |
180 | diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c |
181 | index 692401e941a77..7502fa84e2537 100644 |
182 | --- a/drivers/iommu/amd_iommu_init.c |
183 | +++ b/drivers/iommu/amd_iommu_init.c |
184 | @@ -21,6 +21,7 @@ |
185 | #include <linux/iommu.h> |
186 | #include <linux/kmemleak.h> |
187 | #include <linux/mem_encrypt.h> |
188 | +#include <linux/iopoll.h> |
189 | #include <asm/pci-direct.h> |
190 | #include <asm/iommu.h> |
191 | #include <asm/apic.h> |
192 | @@ -759,6 +760,7 @@ static int iommu_ga_log_enable(struct amd_iommu *iommu) |
193 | status = readl(iommu->mmio_base + MMIO_STATUS_OFFSET); |
194 | if (status & (MMIO_STATUS_GALOG_RUN_MASK)) |
195 | break; |
196 | + udelay(10); |
197 | } |
198 | |
199 | if (i >= LOOP_TIMEOUT) |
200 | diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c |
201 | index 5dcc81b1df623..f3b299b5c1c06 100644 |
202 | --- a/drivers/iommu/intel_irq_remapping.c |
203 | +++ b/drivers/iommu/intel_irq_remapping.c |
204 | @@ -570,9 +570,8 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu) |
205 | fn, &intel_ir_domain_ops, |
206 | iommu); |
207 | if (!iommu->ir_domain) { |
208 | - irq_domain_free_fwnode(fn); |
209 | pr_err("IR%d: failed to allocate irqdomain\n", iommu->seq_id); |
210 | - goto out_free_bitmap; |
211 | + goto out_free_fwnode; |
212 | } |
213 | iommu->ir_msi_domain = |
214 | arch_create_remap_msi_irq_domain(iommu->ir_domain, |
215 | @@ -596,7 +595,7 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu) |
216 | |
217 | if (dmar_enable_qi(iommu)) { |
218 | pr_err("Failed to enable queued invalidation\n"); |
219 | - goto out_free_bitmap; |
220 | + goto out_free_ir_domain; |
221 | } |
222 | } |
223 | |
224 | @@ -620,6 +619,14 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu) |
225 | |
226 | return 0; |
227 | |
228 | +out_free_ir_domain: |
229 | + if (iommu->ir_msi_domain) |
230 | + irq_domain_remove(iommu->ir_msi_domain); |
231 | + iommu->ir_msi_domain = NULL; |
232 | + irq_domain_remove(iommu->ir_domain); |
233 | + iommu->ir_domain = NULL; |
234 | +out_free_fwnode: |
235 | + irq_domain_free_fwnode(fn); |
236 | out_free_bitmap: |
237 | bitmap_free(bitmap); |
238 | out_free_pages: |
239 | diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h b/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h |
240 | index 292b880f3f9fc..3587b2e7843ef 100644 |
241 | --- a/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h |
242 | +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h |
243 | @@ -128,6 +128,7 @@ |
244 | |
245 | #define NUM_DWMAC100_DMA_REGS 9 |
246 | #define NUM_DWMAC1000_DMA_REGS 23 |
247 | +#define NUM_DWMAC4_DMA_REGS 27 |
248 | |
249 | void dwmac_enable_dma_transmission(void __iomem *ioaddr); |
250 | void dwmac_enable_dma_irq(void __iomem *ioaddr, u32 chan); |
251 | diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c |
252 | index ce1346c14b05a..30b9393ae8f2f 100644 |
253 | --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c |
254 | +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c |
255 | @@ -21,10 +21,18 @@ |
256 | #include "dwxgmac2.h" |
257 | |
258 | #define REG_SPACE_SIZE 0x1060 |
259 | +#define GMAC4_REG_SPACE_SIZE 0x116C |
260 | #define MAC100_ETHTOOL_NAME "st_mac100" |
261 | #define GMAC_ETHTOOL_NAME "st_gmac" |
262 | #define XGMAC_ETHTOOL_NAME "st_xgmac" |
263 | |
264 | +/* Same as DMA_CHAN_BASE_ADDR defined in dwmac4_dma.h |
265 | + * |
266 | + * It is here because dwmac_dma.h and dwmac4_dam.h can not be included at the |
267 | + * same time due to the conflicting macro names. |
268 | + */ |
269 | +#define GMAC4_DMA_CHAN_BASE_ADDR 0x00001100 |
270 | + |
271 | #define ETHTOOL_DMA_OFFSET 55 |
272 | |
273 | struct stmmac_stats { |
274 | @@ -413,6 +421,8 @@ static int stmmac_ethtool_get_regs_len(struct net_device *dev) |
275 | |
276 | if (priv->plat->has_xgmac) |
277 | return XGMAC_REGSIZE * 4; |
278 | + else if (priv->plat->has_gmac4) |
279 | + return GMAC4_REG_SPACE_SIZE; |
280 | return REG_SPACE_SIZE; |
281 | } |
282 | |
283 | @@ -425,8 +435,13 @@ static void stmmac_ethtool_gregs(struct net_device *dev, |
284 | stmmac_dump_mac_regs(priv, priv->hw, reg_space); |
285 | stmmac_dump_dma_regs(priv, priv->ioaddr, reg_space); |
286 | |
287 | - if (!priv->plat->has_xgmac) { |
288 | - /* Copy DMA registers to where ethtool expects them */ |
289 | + /* Copy DMA registers to where ethtool expects them */ |
290 | + if (priv->plat->has_gmac4) { |
291 | + /* GMAC4 dumps its DMA registers at its DMA_CHAN_BASE_ADDR */ |
292 | + memcpy(®_space[ETHTOOL_DMA_OFFSET], |
293 | + ®_space[GMAC4_DMA_CHAN_BASE_ADDR / 4], |
294 | + NUM_DWMAC4_DMA_REGS * 4); |
295 | + } else if (!priv->plat->has_xgmac) { |
296 | memcpy(®_space[ETHTOOL_DMA_OFFSET], |
297 | ®_space[DMA_BUS_MODE / 4], |
298 | NUM_DWMAC1000_DMA_REGS * 4); |
299 | diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c |
300 | index e5d9007c8090b..8c14c99663941 100644 |
301 | --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c |
302 | +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c |
303 | @@ -149,15 +149,20 @@ static int adjust_systime(void __iomem *ioaddr, u32 sec, u32 nsec, |
304 | |
305 | static void get_systime(void __iomem *ioaddr, u64 *systime) |
306 | { |
307 | - u64 ns; |
308 | - |
309 | - /* Get the TSSS value */ |
310 | - ns = readl(ioaddr + PTP_STNSR); |
311 | - /* Get the TSS and convert sec time value to nanosecond */ |
312 | - ns += readl(ioaddr + PTP_STSR) * 1000000000ULL; |
313 | + u64 ns, sec0, sec1; |
314 | + |
315 | + /* Get the TSS value */ |
316 | + sec1 = readl_relaxed(ioaddr + PTP_STSR); |
317 | + do { |
318 | + sec0 = sec1; |
319 | + /* Get the TSSS value */ |
320 | + ns = readl_relaxed(ioaddr + PTP_STNSR); |
321 | + /* Get the TSS value */ |
322 | + sec1 = readl_relaxed(ioaddr + PTP_STSR); |
323 | + } while (sec0 != sec1); |
324 | |
325 | if (systime) |
326 | - *systime = ns; |
327 | + *systime = ns + (sec1 * 1000000000ULL); |
328 | } |
329 | |
330 | const struct stmmac_hwtimestamp stmmac_ptp = { |
331 | diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c |
332 | index 25dbea302fb6d..7c131a423cafa 100644 |
333 | --- a/drivers/net/ieee802154/ca8210.c |
334 | +++ b/drivers/net/ieee802154/ca8210.c |
335 | @@ -1770,6 +1770,7 @@ static int ca8210_async_xmit_complete( |
336 | status |
337 | ); |
338 | if (status != MAC_TRANSACTION_OVERFLOW) { |
339 | + dev_kfree_skb_any(priv->tx_skb); |
340 | ieee802154_wake_queue(priv->hw); |
341 | return 0; |
342 | } |
343 | diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c |
344 | index 2a78084aeaedb..1d181eff0c299 100644 |
345 | --- a/drivers/net/ieee802154/mac802154_hwsim.c |
346 | +++ b/drivers/net/ieee802154/mac802154_hwsim.c |
347 | @@ -786,6 +786,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev, |
348 | goto err_pib; |
349 | } |
350 | |
351 | + pib->channel = 13; |
352 | rcu_assign_pointer(phy->pib, pib); |
353 | phy->idx = idx; |
354 | INIT_LIST_HEAD(&phy->edges); |
355 | diff --git a/drivers/net/ieee802154/mcr20a.c b/drivers/net/ieee802154/mcr20a.c |
356 | index 8dc04e2590b18..383231b854642 100644 |
357 | --- a/drivers/net/ieee802154/mcr20a.c |
358 | +++ b/drivers/net/ieee802154/mcr20a.c |
359 | @@ -976,8 +976,8 @@ static void mcr20a_hw_setup(struct mcr20a_local *lp) |
360 | dev_dbg(printdev(lp), "%s\n", __func__); |
361 | |
362 | phy->symbol_duration = 16; |
363 | - phy->lifs_period = 40; |
364 | - phy->sifs_period = 12; |
365 | + phy->lifs_period = 40 * phy->symbol_duration; |
366 | + phy->sifs_period = 12 * phy->symbol_duration; |
367 | |
368 | hw->flags = IEEE802154_HW_TX_OMIT_CKSUM | |
369 | IEEE802154_HW_AFILT | |
370 | diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c |
371 | index f233a6933a976..f729f55f6a174 100644 |
372 | --- a/drivers/net/macsec.c |
373 | +++ b/drivers/net/macsec.c |
374 | @@ -3247,6 +3247,15 @@ static int macsec_newlink(struct net *net, struct net_device *dev, |
375 | |
376 | macsec->real_dev = real_dev; |
377 | |
378 | + /* send_sci must be set to true when transmit sci explicitly is set */ |
379 | + if ((data && data[IFLA_MACSEC_SCI]) && |
380 | + (data && data[IFLA_MACSEC_INC_SCI])) { |
381 | + u8 send_sci = !!nla_get_u8(data[IFLA_MACSEC_INC_SCI]); |
382 | + |
383 | + if (!send_sci) |
384 | + return -EINVAL; |
385 | + } |
386 | + |
387 | if (data && data[IFLA_MACSEC_ICV_LEN]) |
388 | icv_len = nla_get_u8(data[IFLA_MACSEC_ICV_LEN]); |
389 | mtu = real_dev->mtu - icv_len - macsec_extra_len(true); |
390 | diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c |
391 | index fa742535f6791..e4da3217e9398 100644 |
392 | --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c |
393 | +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c |
394 | @@ -1261,16 +1261,18 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) |
395 | sizeof(*girq->parents), |
396 | GFP_KERNEL); |
397 | if (!girq->parents) { |
398 | - pinctrl_remove_gpio_range(pc->pctl_dev, &pc->gpio_range); |
399 | - return -ENOMEM; |
400 | + err = -ENOMEM; |
401 | + goto out_remove; |
402 | } |
403 | |
404 | if (is_7211) { |
405 | pc->wake_irq = devm_kcalloc(dev, BCM2835_NUM_IRQS, |
406 | sizeof(*pc->wake_irq), |
407 | GFP_KERNEL); |
408 | - if (!pc->wake_irq) |
409 | - return -ENOMEM; |
410 | + if (!pc->wake_irq) { |
411 | + err = -ENOMEM; |
412 | + goto out_remove; |
413 | + } |
414 | } |
415 | |
416 | /* |
417 | @@ -1294,8 +1296,10 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) |
418 | |
419 | len = strlen(dev_name(pc->dev)) + 16; |
420 | name = devm_kzalloc(pc->dev, len, GFP_KERNEL); |
421 | - if (!name) |
422 | - return -ENOMEM; |
423 | + if (!name) { |
424 | + err = -ENOMEM; |
425 | + goto out_remove; |
426 | + } |
427 | |
428 | snprintf(name, len, "%s:bank%d", dev_name(pc->dev), i); |
429 | |
430 | @@ -1314,11 +1318,14 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) |
431 | err = gpiochip_add_data(&pc->gpio_chip, pc); |
432 | if (err) { |
433 | dev_err(dev, "could not add GPIO chip\n"); |
434 | - pinctrl_remove_gpio_range(pc->pctl_dev, &pc->gpio_range); |
435 | - return err; |
436 | + goto out_remove; |
437 | } |
438 | |
439 | return 0; |
440 | + |
441 | +out_remove: |
442 | + pinctrl_remove_gpio_range(pc->pctl_dev, &pc->gpio_range); |
443 | + return err; |
444 | } |
445 | |
446 | static struct platform_driver bcm2835_pinctrl_driver = { |
447 | diff --git a/drivers/rtc/rtc-mc146818-lib.c b/drivers/rtc/rtc-mc146818-lib.c |
448 | index 2ecd8752b088b..5add637c9ad23 100644 |
449 | --- a/drivers/rtc/rtc-mc146818-lib.c |
450 | +++ b/drivers/rtc/rtc-mc146818-lib.c |
451 | @@ -83,7 +83,7 @@ unsigned int mc146818_get_time(struct rtc_time *time) |
452 | time->tm_year += real_year - 72; |
453 | #endif |
454 | |
455 | - if (century > 20) |
456 | + if (century > 19) |
457 | time->tm_year += (century - 19) * 100; |
458 | |
459 | /* |
460 | diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c |
461 | index e6c3e7c070aaf..9ed109fb6b67b 100644 |
462 | --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c |
463 | +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c |
464 | @@ -506,7 +506,8 @@ static int bnx2fc_l2_rcv_thread(void *arg) |
465 | |
466 | static void bnx2fc_recv_frame(struct sk_buff *skb) |
467 | { |
468 | - u32 fr_len; |
469 | + u64 crc_err; |
470 | + u32 fr_len, fr_crc; |
471 | struct fc_lport *lport; |
472 | struct fcoe_rcv_info *fr; |
473 | struct fc_stats *stats; |
474 | @@ -540,6 +541,11 @@ static void bnx2fc_recv_frame(struct sk_buff *skb) |
475 | skb_pull(skb, sizeof(struct fcoe_hdr)); |
476 | fr_len = skb->len - sizeof(struct fcoe_crc_eof); |
477 | |
478 | + stats = per_cpu_ptr(lport->stats, get_cpu()); |
479 | + stats->RxFrames++; |
480 | + stats->RxWords += fr_len / FCOE_WORD_TO_BYTE; |
481 | + put_cpu(); |
482 | + |
483 | fp = (struct fc_frame *)skb; |
484 | fc_frame_init(fp); |
485 | fr_dev(fp) = lport; |
486 | @@ -622,16 +628,15 @@ static void bnx2fc_recv_frame(struct sk_buff *skb) |
487 | return; |
488 | } |
489 | |
490 | - stats = per_cpu_ptr(lport->stats, smp_processor_id()); |
491 | - stats->RxFrames++; |
492 | - stats->RxWords += fr_len / FCOE_WORD_TO_BYTE; |
493 | + fr_crc = le32_to_cpu(fr_crc(fp)); |
494 | |
495 | - if (le32_to_cpu(fr_crc(fp)) != |
496 | - ~crc32(~0, skb->data, fr_len)) { |
497 | - if (stats->InvalidCRCCount < 5) |
498 | + if (unlikely(fr_crc != ~crc32(~0, skb->data, fr_len))) { |
499 | + stats = per_cpu_ptr(lport->stats, get_cpu()); |
500 | + crc_err = (stats->InvalidCRCCount++); |
501 | + put_cpu(); |
502 | + if (crc_err < 5) |
503 | printk(KERN_WARNING PFX "dropping frame with " |
504 | "CRC error\n"); |
505 | - stats->InvalidCRCCount++; |
506 | kfree_skb(skb); |
507 | return; |
508 | } |
509 | diff --git a/drivers/soc/mediatek/mtk-scpsys.c b/drivers/soc/mediatek/mtk-scpsys.c |
510 | index 71afa2a99b17f..75f25f08245fd 100644 |
511 | --- a/drivers/soc/mediatek/mtk-scpsys.c |
512 | +++ b/drivers/soc/mediatek/mtk-scpsys.c |
513 | @@ -333,17 +333,12 @@ out: |
514 | return ret; |
515 | } |
516 | |
517 | -static int init_clks(struct platform_device *pdev, struct clk **clk) |
518 | +static void init_clks(struct platform_device *pdev, struct clk **clk) |
519 | { |
520 | int i; |
521 | |
522 | - for (i = CLK_NONE + 1; i < CLK_MAX; i++) { |
523 | + for (i = CLK_NONE + 1; i < CLK_MAX; i++) |
524 | clk[i] = devm_clk_get(&pdev->dev, clk_names[i]); |
525 | - if (IS_ERR(clk[i])) |
526 | - return PTR_ERR(clk[i]); |
527 | - } |
528 | - |
529 | - return 0; |
530 | } |
531 | |
532 | static struct scp *init_scp(struct platform_device *pdev, |
533 | @@ -353,7 +348,7 @@ static struct scp *init_scp(struct platform_device *pdev, |
534 | { |
535 | struct genpd_onecell_data *pd_data; |
536 | struct resource *res; |
537 | - int i, j, ret; |
538 | + int i, j; |
539 | struct scp *scp; |
540 | struct clk *clk[CLK_MAX]; |
541 | |
542 | @@ -408,9 +403,7 @@ static struct scp *init_scp(struct platform_device *pdev, |
543 | |
544 | pd_data->num_domains = num; |
545 | |
546 | - ret = init_clks(pdev, clk); |
547 | - if (ret) |
548 | - return ERR_PTR(ret); |
549 | + init_clks(pdev, clk); |
550 | |
551 | for (i = 0; i < num; i++) { |
552 | struct scp_domain *scpd = &scp->domains[i]; |
553 | diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c |
554 | index 8a1176efa4c85..3755be04346a6 100644 |
555 | --- a/drivers/spi/spi-bcm-qspi.c |
556 | +++ b/drivers/spi/spi-bcm-qspi.c |
557 | @@ -509,7 +509,7 @@ static void bcm_qspi_chip_select(struct bcm_qspi *qspi, int cs) |
558 | u32 rd = 0; |
559 | u32 wr = 0; |
560 | |
561 | - if (qspi->base[CHIP_SELECT]) { |
562 | + if (cs >= 0 && qspi->base[CHIP_SELECT]) { |
563 | rd = bcm_qspi_read(qspi, CHIP_SELECT, 0); |
564 | wr = (rd & ~0xff) | (1 << cs); |
565 | if (rd == wr) |
566 | diff --git a/drivers/spi/spi-meson-spicc.c b/drivers/spi/spi-meson-spicc.c |
567 | index 3c841ae0a3e91..c9c4c0f2e8b7a 100644 |
568 | --- a/drivers/spi/spi-meson-spicc.c |
569 | +++ b/drivers/spi/spi-meson-spicc.c |
570 | @@ -527,6 +527,11 @@ static int meson_spicc_probe(struct platform_device *pdev) |
571 | writel_relaxed(0, spicc->base + SPICC_INTREG); |
572 | |
573 | irq = platform_get_irq(pdev, 0); |
574 | + if (irq < 0) { |
575 | + ret = irq; |
576 | + goto out_master; |
577 | + } |
578 | + |
579 | ret = devm_request_irq(&pdev->dev, irq, meson_spicc_irq, |
580 | 0, NULL, spicc); |
581 | if (ret) { |
582 | diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c |
583 | index cafb773f78616..29d44f5d5212c 100644 |
584 | --- a/drivers/spi/spi-mt65xx.c |
585 | +++ b/drivers/spi/spi-mt65xx.c |
586 | @@ -533,7 +533,7 @@ static irqreturn_t mtk_spi_interrupt(int irq, void *dev_id) |
587 | else |
588 | mdata->state = MTK_SPI_IDLE; |
589 | |
590 | - if (!master->can_dma(master, master->cur_msg->spi, trans)) { |
591 | + if (!master->can_dma(master, NULL, trans)) { |
592 | if (trans->rx_buf) { |
593 | cnt = mdata->xfer_len / 4; |
594 | ioread32_rep(mdata->base + SPI_RX_DATA_REG, |
595 | diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c |
596 | index 2ee61596164be..a5041bf0d5db1 100644 |
597 | --- a/fs/btrfs/qgroup.c |
598 | +++ b/fs/btrfs/qgroup.c |
599 | @@ -1105,9 +1105,24 @@ int btrfs_quota_disable(struct btrfs_fs_info *fs_info) |
600 | struct btrfs_trans_handle *trans = NULL; |
601 | int ret = 0; |
602 | |
603 | + /* |
604 | + * We need to have subvol_sem write locked, to prevent races between |
605 | + * concurrent tasks trying to disable quotas, because we will unlock |
606 | + * and relock qgroup_ioctl_lock across BTRFS_FS_QUOTA_ENABLED changes. |
607 | + */ |
608 | + lockdep_assert_held_write(&fs_info->subvol_sem); |
609 | + |
610 | mutex_lock(&fs_info->qgroup_ioctl_lock); |
611 | if (!fs_info->quota_root) |
612 | goto out; |
613 | + |
614 | + /* |
615 | + * Request qgroup rescan worker to complete and wait for it. This wait |
616 | + * must be done before transaction start for quota disable since it may |
617 | + * deadlock with transaction by the qgroup rescan worker. |
618 | + */ |
619 | + clear_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags); |
620 | + btrfs_qgroup_wait_for_completion(fs_info, false); |
621 | mutex_unlock(&fs_info->qgroup_ioctl_lock); |
622 | |
623 | /* |
624 | @@ -1125,14 +1140,13 @@ int btrfs_quota_disable(struct btrfs_fs_info *fs_info) |
625 | if (IS_ERR(trans)) { |
626 | ret = PTR_ERR(trans); |
627 | trans = NULL; |
628 | + set_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags); |
629 | goto out; |
630 | } |
631 | |
632 | if (!fs_info->quota_root) |
633 | goto out; |
634 | |
635 | - clear_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags); |
636 | - btrfs_qgroup_wait_for_completion(fs_info, false); |
637 | spin_lock(&fs_info->qgroup_lock); |
638 | quota_root = fs_info->quota_root; |
639 | fs_info->quota_root = NULL; |
640 | @@ -3304,6 +3318,9 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid, |
641 | btrfs_warn(fs_info, |
642 | "qgroup rescan init failed, qgroup is not enabled"); |
643 | ret = -EINVAL; |
644 | + } else if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags)) { |
645 | + /* Quota disable is in progress */ |
646 | + ret = -EBUSY; |
647 | } |
648 | |
649 | if (ret) { |
650 | diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c |
651 | index cdb10e9fded65..8f665aa1d706e 100644 |
652 | --- a/fs/ext4/inline.c |
653 | +++ b/fs/ext4/inline.c |
654 | @@ -1120,7 +1120,15 @@ static void ext4_restore_inline_data(handle_t *handle, struct inode *inode, |
655 | struct ext4_iloc *iloc, |
656 | void *buf, int inline_size) |
657 | { |
658 | - ext4_create_inline_data(handle, inode, inline_size); |
659 | + int ret; |
660 | + |
661 | + ret = ext4_create_inline_data(handle, inode, inline_size); |
662 | + if (ret) { |
663 | + ext4_msg(inode->i_sb, KERN_EMERG, |
664 | + "error restoring inline_data for inode -- potential data loss! (inode %lu, error %d)", |
665 | + inode->i_ino, ret); |
666 | + return; |
667 | + } |
668 | ext4_write_inline_data(inode, iloc, buf, 0, inline_size); |
669 | ext4_set_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA); |
670 | } |
671 | diff --git a/fs/fs_context.c b/fs/fs_context.c |
672 | index a2367c7aef5b3..e492a83fa100e 100644 |
673 | --- a/fs/fs_context.c |
674 | +++ b/fs/fs_context.c |
675 | @@ -258,7 +258,7 @@ static struct fs_context *alloc_fs_context(struct file_system_type *fs_type, |
676 | struct fs_context *fc; |
677 | int ret = -ENOMEM; |
678 | |
679 | - fc = kzalloc(sizeof(struct fs_context), GFP_KERNEL); |
680 | + fc = kzalloc(sizeof(struct fs_context), GFP_KERNEL_ACCOUNT); |
681 | if (!fc) |
682 | return ERR_PTR(-ENOMEM); |
683 | |
684 | @@ -686,7 +686,7 @@ const struct fs_context_operations legacy_fs_context_ops = { |
685 | */ |
686 | static int legacy_init_fs_context(struct fs_context *fc) |
687 | { |
688 | - fc->fs_private = kzalloc(sizeof(struct legacy_fs_context), GFP_KERNEL); |
689 | + fc->fs_private = kzalloc(sizeof(struct legacy_fs_context), GFP_KERNEL_ACCOUNT); |
690 | if (!fc->fs_private) |
691 | return -ENOMEM; |
692 | fc->ops = &legacy_fs_context_ops; |
693 | diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c |
694 | index a48fcd4180c74..62eb78ac7437f 100644 |
695 | --- a/fs/nfsd/nfs4state.c |
696 | +++ b/fs/nfsd/nfs4state.c |
697 | @@ -3941,8 +3941,10 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, |
698 | status = nfserr_clid_inuse; |
699 | if (client_has_state(old) |
700 | && !same_creds(&unconf->cl_cred, |
701 | - &old->cl_cred)) |
702 | + &old->cl_cred)) { |
703 | + old = NULL; |
704 | goto out; |
705 | + } |
706 | status = mark_client_expired_locked(old); |
707 | if (status) { |
708 | old = NULL; |
709 | diff --git a/kernel/audit.c b/kernel/audit.c |
710 | index 146edff0c73ec..db8141866ceaa 100644 |
711 | --- a/kernel/audit.c |
712 | +++ b/kernel/audit.c |
713 | @@ -535,20 +535,22 @@ static void kauditd_printk_skb(struct sk_buff *skb) |
714 | /** |
715 | * kauditd_rehold_skb - Handle a audit record send failure in the hold queue |
716 | * @skb: audit record |
717 | + * @error: error code (unused) |
718 | * |
719 | * Description: |
720 | * This should only be used by the kauditd_thread when it fails to flush the |
721 | * hold queue. |
722 | */ |
723 | -static void kauditd_rehold_skb(struct sk_buff *skb) |
724 | +static void kauditd_rehold_skb(struct sk_buff *skb, __always_unused int error) |
725 | { |
726 | - /* put the record back in the queue at the same place */ |
727 | - skb_queue_head(&audit_hold_queue, skb); |
728 | + /* put the record back in the queue */ |
729 | + skb_queue_tail(&audit_hold_queue, skb); |
730 | } |
731 | |
732 | /** |
733 | * kauditd_hold_skb - Queue an audit record, waiting for auditd |
734 | * @skb: audit record |
735 | + * @error: error code |
736 | * |
737 | * Description: |
738 | * Queue the audit record, waiting for an instance of auditd. When this |
739 | @@ -558,19 +560,31 @@ static void kauditd_rehold_skb(struct sk_buff *skb) |
740 | * and queue it, if we have room. If we want to hold on to the record, but we |
741 | * don't have room, record a record lost message. |
742 | */ |
743 | -static void kauditd_hold_skb(struct sk_buff *skb) |
744 | +static void kauditd_hold_skb(struct sk_buff *skb, int error) |
745 | { |
746 | /* at this point it is uncertain if we will ever send this to auditd so |
747 | * try to send the message via printk before we go any further */ |
748 | kauditd_printk_skb(skb); |
749 | |
750 | /* can we just silently drop the message? */ |
751 | - if (!audit_default) { |
752 | - kfree_skb(skb); |
753 | - return; |
754 | + if (!audit_default) |
755 | + goto drop; |
756 | + |
757 | + /* the hold queue is only for when the daemon goes away completely, |
758 | + * not -EAGAIN failures; if we are in a -EAGAIN state requeue the |
759 | + * record on the retry queue unless it's full, in which case drop it |
760 | + */ |
761 | + if (error == -EAGAIN) { |
762 | + if (!audit_backlog_limit || |
763 | + skb_queue_len(&audit_retry_queue) < audit_backlog_limit) { |
764 | + skb_queue_tail(&audit_retry_queue, skb); |
765 | + return; |
766 | + } |
767 | + audit_log_lost("kauditd retry queue overflow"); |
768 | + goto drop; |
769 | } |
770 | |
771 | - /* if we have room, queue the message */ |
772 | + /* if we have room in the hold queue, queue the message */ |
773 | if (!audit_backlog_limit || |
774 | skb_queue_len(&audit_hold_queue) < audit_backlog_limit) { |
775 | skb_queue_tail(&audit_hold_queue, skb); |
776 | @@ -579,24 +593,32 @@ static void kauditd_hold_skb(struct sk_buff *skb) |
777 | |
778 | /* we have no other options - drop the message */ |
779 | audit_log_lost("kauditd hold queue overflow"); |
780 | +drop: |
781 | kfree_skb(skb); |
782 | } |
783 | |
784 | /** |
785 | * kauditd_retry_skb - Queue an audit record, attempt to send again to auditd |
786 | * @skb: audit record |
787 | + * @error: error code (unused) |
788 | * |
789 | * Description: |
790 | * Not as serious as kauditd_hold_skb() as we still have a connected auditd, |
791 | * but for some reason we are having problems sending it audit records so |
792 | * queue the given record and attempt to resend. |
793 | */ |
794 | -static void kauditd_retry_skb(struct sk_buff *skb) |
795 | +static void kauditd_retry_skb(struct sk_buff *skb, __always_unused int error) |
796 | { |
797 | - /* NOTE: because records should only live in the retry queue for a |
798 | - * short period of time, before either being sent or moved to the hold |
799 | - * queue, we don't currently enforce a limit on this queue */ |
800 | - skb_queue_tail(&audit_retry_queue, skb); |
801 | + if (!audit_backlog_limit || |
802 | + skb_queue_len(&audit_retry_queue) < audit_backlog_limit) { |
803 | + skb_queue_tail(&audit_retry_queue, skb); |
804 | + return; |
805 | + } |
806 | + |
807 | + /* we have to drop the record, send it via printk as a last effort */ |
808 | + kauditd_printk_skb(skb); |
809 | + audit_log_lost("kauditd retry queue overflow"); |
810 | + kfree_skb(skb); |
811 | } |
812 | |
813 | /** |
814 | @@ -634,7 +656,7 @@ static void auditd_reset(const struct auditd_connection *ac) |
815 | /* flush the retry queue to the hold queue, but don't touch the main |
816 | * queue since we need to process that normally for multicast */ |
817 | while ((skb = skb_dequeue(&audit_retry_queue))) |
818 | - kauditd_hold_skb(skb); |
819 | + kauditd_hold_skb(skb, -ECONNREFUSED); |
820 | } |
821 | |
822 | /** |
823 | @@ -708,16 +730,18 @@ static int kauditd_send_queue(struct sock *sk, u32 portid, |
824 | struct sk_buff_head *queue, |
825 | unsigned int retry_limit, |
826 | void (*skb_hook)(struct sk_buff *skb), |
827 | - void (*err_hook)(struct sk_buff *skb)) |
828 | + void (*err_hook)(struct sk_buff *skb, int error)) |
829 | { |
830 | int rc = 0; |
831 | - struct sk_buff *skb; |
832 | + struct sk_buff *skb = NULL; |
833 | + struct sk_buff *skb_tail; |
834 | unsigned int failed = 0; |
835 | |
836 | /* NOTE: kauditd_thread takes care of all our locking, we just use |
837 | * the netlink info passed to us (e.g. sk and portid) */ |
838 | |
839 | - while ((skb = skb_dequeue(queue))) { |
840 | + skb_tail = skb_peek_tail(queue); |
841 | + while ((skb != skb_tail) && (skb = skb_dequeue(queue))) { |
842 | /* call the skb_hook for each skb we touch */ |
843 | if (skb_hook) |
844 | (*skb_hook)(skb); |
845 | @@ -725,7 +749,7 @@ static int kauditd_send_queue(struct sock *sk, u32 portid, |
846 | /* can we send to anyone via unicast? */ |
847 | if (!sk) { |
848 | if (err_hook) |
849 | - (*err_hook)(skb); |
850 | + (*err_hook)(skb, -ECONNREFUSED); |
851 | continue; |
852 | } |
853 | |
854 | @@ -739,7 +763,7 @@ retry: |
855 | rc == -ECONNREFUSED || rc == -EPERM) { |
856 | sk = NULL; |
857 | if (err_hook) |
858 | - (*err_hook)(skb); |
859 | + (*err_hook)(skb, rc); |
860 | if (rc == -EAGAIN) |
861 | rc = 0; |
862 | /* continue to drain the queue */ |
863 | diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c |
864 | index 411be8b2e837e..ad9dffed8411d 100644 |
865 | --- a/kernel/cgroup/cpuset.c |
866 | +++ b/kernel/cgroup/cpuset.c |
867 | @@ -1473,10 +1473,15 @@ static void update_sibling_cpumasks(struct cpuset *parent, struct cpuset *cs, |
868 | struct cpuset *sibling; |
869 | struct cgroup_subsys_state *pos_css; |
870 | |
871 | + percpu_rwsem_assert_held(&cpuset_rwsem); |
872 | + |
873 | /* |
874 | * Check all its siblings and call update_cpumasks_hier() |
875 | * if their use_parent_ecpus flag is set in order for them |
876 | * to use the right effective_cpus value. |
877 | + * |
878 | + * The update_cpumasks_hier() function may sleep. So we have to |
879 | + * release the RCU read lock before calling it. |
880 | */ |
881 | rcu_read_lock(); |
882 | cpuset_for_each_child(sibling, pos_css, parent) { |
883 | @@ -1484,8 +1489,13 @@ static void update_sibling_cpumasks(struct cpuset *parent, struct cpuset *cs, |
884 | continue; |
885 | if (!sibling->use_parent_ecpus) |
886 | continue; |
887 | + if (!css_tryget_online(&sibling->css)) |
888 | + continue; |
889 | |
890 | + rcu_read_unlock(); |
891 | update_cpumasks_hier(sibling, tmp); |
892 | + rcu_read_lock(); |
893 | + css_put(&sibling->css); |
894 | } |
895 | rcu_read_unlock(); |
896 | } |
897 | diff --git a/mm/kmemleak.c b/mm/kmemleak.c |
898 | index 312942d784058..4a669c81f4e22 100644 |
899 | --- a/mm/kmemleak.c |
900 | +++ b/mm/kmemleak.c |
901 | @@ -1399,7 +1399,8 @@ static void kmemleak_scan(void) |
902 | { |
903 | unsigned long flags; |
904 | struct kmemleak_object *object; |
905 | - int i; |
906 | + struct zone *zone; |
907 | + int __maybe_unused i; |
908 | int new_leaks = 0; |
909 | |
910 | jiffies_last_scan = jiffies; |
911 | @@ -1439,9 +1440,9 @@ static void kmemleak_scan(void) |
912 | * Struct page scanning for each node. |
913 | */ |
914 | get_online_mems(); |
915 | - for_each_online_node(i) { |
916 | - unsigned long start_pfn = node_start_pfn(i); |
917 | - unsigned long end_pfn = node_end_pfn(i); |
918 | + for_each_populated_zone(zone) { |
919 | + unsigned long start_pfn = zone->zone_start_pfn; |
920 | + unsigned long end_pfn = zone_end_pfn(zone); |
921 | unsigned long pfn; |
922 | |
923 | for (pfn = start_pfn; pfn < end_pfn; pfn++) { |
924 | @@ -1450,8 +1451,8 @@ static void kmemleak_scan(void) |
925 | if (!page) |
926 | continue; |
927 | |
928 | - /* only scan pages belonging to this node */ |
929 | - if (page_to_nid(page) != i) |
930 | + /* only scan pages belonging to this zone */ |
931 | + if (page_zone(page) != zone) |
932 | continue; |
933 | /* only scan if page is in use */ |
934 | if (page_count(page) == 0) |
935 | diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c |
936 | index b2ba1d2556f14..e0df892b5c370 100644 |
937 | --- a/net/ieee802154/nl802154.c |
938 | +++ b/net/ieee802154/nl802154.c |
939 | @@ -1457,7 +1457,7 @@ static int nl802154_send_key(struct sk_buff *msg, u32 cmd, u32 portid, |
940 | |
941 | hdr = nl802154hdr_put(msg, portid, seq, flags, cmd); |
942 | if (!hdr) |
943 | - return -1; |
944 | + return -ENOBUFS; |
945 | |
946 | if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex)) |
947 | goto nla_put_failure; |
948 | @@ -1650,7 +1650,7 @@ static int nl802154_send_device(struct sk_buff *msg, u32 cmd, u32 portid, |
949 | |
950 | hdr = nl802154hdr_put(msg, portid, seq, flags, cmd); |
951 | if (!hdr) |
952 | - return -1; |
953 | + return -ENOBUFS; |
954 | |
955 | if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex)) |
956 | goto nla_put_failure; |
957 | @@ -1828,7 +1828,7 @@ static int nl802154_send_devkey(struct sk_buff *msg, u32 cmd, u32 portid, |
958 | |
959 | hdr = nl802154hdr_put(msg, portid, seq, flags, cmd); |
960 | if (!hdr) |
961 | - return -1; |
962 | + return -ENOBUFS; |
963 | |
964 | if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex)) |
965 | goto nla_put_failure; |
966 | @@ -2004,7 +2004,7 @@ static int nl802154_send_seclevel(struct sk_buff *msg, u32 cmd, u32 portid, |
967 | |
968 | hdr = nl802154hdr_put(msg, portid, seq, flags, cmd); |
969 | if (!hdr) |
970 | - return -1; |
971 | + return -ENOBUFS; |
972 | |
973 | if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex)) |
974 | goto nla_put_failure; |
975 | diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
976 | index d06205626cd54..c03448ea8a203 100644 |
977 | --- a/sound/pci/hda/patch_realtek.c |
978 | +++ b/sound/pci/hda/patch_realtek.c |
979 | @@ -2122,6 +2122,7 @@ static void alc1220_fixup_gb_x570(struct hda_codec *codec, |
980 | { |
981 | static const hda_nid_t conn1[] = { 0x0c }; |
982 | static const struct coef_fw gb_x570_coefs[] = { |
983 | + WRITE_COEF(0x07, 0x03c0), |
984 | WRITE_COEF(0x1a, 0x01c1), |
985 | WRITE_COEF(0x1b, 0x0202), |
986 | WRITE_COEF(0x43, 0x3005), |
987 | @@ -2548,7 +2549,8 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
988 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), |
989 | SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), |
990 | SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570), |
991 | - SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950), |
992 | + SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570), |
993 | + SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570), |
994 | SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950), |
995 | SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950), |
996 | SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950), |
997 | @@ -2623,6 +2625,7 @@ static const struct hda_model_fixup alc882_fixup_models[] = { |
998 | {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, |
999 | {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"}, |
1000 | {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, |
1001 | + {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"}, |
1002 | {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"}, |
1003 | {} |
1004 | }; |
1005 | @@ -8180,6 +8183,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
1006 | SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), |
1007 | SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401), |
1008 | SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), |
1009 | + SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401), |
1010 | SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), |
1011 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), |
1012 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), |
1013 | diff --git a/sound/soc/codecs/cpcap.c b/sound/soc/codecs/cpcap.c |
1014 | index 1902689c5ea2c..acd88fe38cd4c 100644 |
1015 | --- a/sound/soc/codecs/cpcap.c |
1016 | +++ b/sound/soc/codecs/cpcap.c |
1017 | @@ -1541,6 +1541,8 @@ static int cpcap_codec_probe(struct platform_device *pdev) |
1018 | { |
1019 | struct device_node *codec_node = |
1020 | of_get_child_by_name(pdev->dev.parent->of_node, "audio-codec"); |
1021 | + if (!codec_node) |
1022 | + return -ENODEV; |
1023 | |
1024 | pdev->dev.of_node = codec_node; |
1025 | |
1026 | diff --git a/sound/soc/codecs/max9759.c b/sound/soc/codecs/max9759.c |
1027 | index 00e9d4fd1651f..0c261335c8a16 100644 |
1028 | --- a/sound/soc/codecs/max9759.c |
1029 | +++ b/sound/soc/codecs/max9759.c |
1030 | @@ -64,7 +64,8 @@ static int speaker_gain_control_put(struct snd_kcontrol *kcontrol, |
1031 | struct snd_soc_component *c = snd_soc_kcontrol_component(kcontrol); |
1032 | struct max9759 *priv = snd_soc_component_get_drvdata(c); |
1033 | |
1034 | - if (ucontrol->value.integer.value[0] > 3) |
1035 | + if (ucontrol->value.integer.value[0] < 0 || |
1036 | + ucontrol->value.integer.value[0] > 3) |
1037 | return -EINVAL; |
1038 | |
1039 | priv->gain = ucontrol->value.integer.value[0]; |
1040 | diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c |
1041 | index af3c3b90c0aca..83b4a22bf15ac 100644 |
1042 | --- a/sound/soc/fsl/pcm030-audio-fabric.c |
1043 | +++ b/sound/soc/fsl/pcm030-audio-fabric.c |
1044 | @@ -93,16 +93,21 @@ static int pcm030_fabric_probe(struct platform_device *op) |
1045 | dev_err(&op->dev, "platform_device_alloc() failed\n"); |
1046 | |
1047 | ret = platform_device_add(pdata->codec_device); |
1048 | - if (ret) |
1049 | + if (ret) { |
1050 | dev_err(&op->dev, "platform_device_add() failed: %d\n", ret); |
1051 | + platform_device_put(pdata->codec_device); |
1052 | + } |
1053 | |
1054 | ret = snd_soc_register_card(card); |
1055 | - if (ret) |
1056 | + if (ret) { |
1057 | dev_err(&op->dev, "snd_soc_register_card() failed: %d\n", ret); |
1058 | + platform_device_del(pdata->codec_device); |
1059 | + platform_device_put(pdata->codec_device); |
1060 | + } |
1061 | |
1062 | platform_set_drvdata(op, pdata); |
1063 | - |
1064 | return ret; |
1065 | + |
1066 | } |
1067 | |
1068 | static int pcm030_fabric_remove(struct platform_device *op) |
1069 | diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c |
1070 | index 95fc24580f85f..ef8fd331526b0 100644 |
1071 | --- a/sound/soc/soc-ops.c |
1072 | +++ b/sound/soc/soc-ops.c |
1073 | @@ -322,13 +322,27 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol, |
1074 | if (sign_bit) |
1075 | mask = BIT(sign_bit + 1) - 1; |
1076 | |
1077 | - val = ((ucontrol->value.integer.value[0] + min) & mask); |
1078 | + val = ucontrol->value.integer.value[0]; |
1079 | + if (mc->platform_max && val > mc->platform_max) |
1080 | + return -EINVAL; |
1081 | + if (val > max - min) |
1082 | + return -EINVAL; |
1083 | + if (val < 0) |
1084 | + return -EINVAL; |
1085 | + val = (val + min) & mask; |
1086 | if (invert) |
1087 | val = max - val; |
1088 | val_mask = mask << shift; |
1089 | val = val << shift; |
1090 | if (snd_soc_volsw_is_stereo(mc)) { |
1091 | - val2 = ((ucontrol->value.integer.value[1] + min) & mask); |
1092 | + val2 = ucontrol->value.integer.value[1]; |
1093 | + if (mc->platform_max && val2 > mc->platform_max) |
1094 | + return -EINVAL; |
1095 | + if (val2 > max - min) |
1096 | + return -EINVAL; |
1097 | + if (val2 < 0) |
1098 | + return -EINVAL; |
1099 | + val2 = (val2 + min) & mask; |
1100 | if (invert) |
1101 | val2 = max - val2; |
1102 | if (reg == reg2) { |
1103 | @@ -422,8 +436,15 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, |
1104 | int err = 0; |
1105 | unsigned int val, val_mask, val2 = 0; |
1106 | |
1107 | + val = ucontrol->value.integer.value[0]; |
1108 | + if (mc->platform_max && val > mc->platform_max) |
1109 | + return -EINVAL; |
1110 | + if (val > max - min) |
1111 | + return -EINVAL; |
1112 | + if (val < 0) |
1113 | + return -EINVAL; |
1114 | val_mask = mask << shift; |
1115 | - val = (ucontrol->value.integer.value[0] + min) & mask; |
1116 | + val = (val + min) & mask; |
1117 | val = val << shift; |
1118 | |
1119 | err = snd_soc_component_update_bits(component, reg, val_mask, val); |
1120 | @@ -889,6 +910,8 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol, |
1121 | unsigned int i, regval, regmask; |
1122 | int err; |
1123 | |
1124 | + if (val < mc->min || val > mc->max) |
1125 | + return -EINVAL; |
1126 | if (invert) |
1127 | val = max - val; |
1128 | val &= mask; |
1129 | diff --git a/sound/soc/xilinx/xlnx_formatter_pcm.c b/sound/soc/xilinx/xlnx_formatter_pcm.c |
1130 | index 1f15c11782ec4..4caee57114b88 100644 |
1131 | --- a/sound/soc/xilinx/xlnx_formatter_pcm.c |
1132 | +++ b/sound/soc/xilinx/xlnx_formatter_pcm.c |
1133 | @@ -37,6 +37,7 @@ |
1134 | #define XLNX_AUD_XFER_COUNT 0x28 |
1135 | #define XLNX_AUD_CH_STS_START 0x2C |
1136 | #define XLNX_BYTES_PER_CH 0x44 |
1137 | +#define XLNX_AUD_ALIGN_BYTES 64 |
1138 | |
1139 | #define AUD_STS_IOC_IRQ_MASK BIT(31) |
1140 | #define AUD_STS_CH_STS_MASK BIT(29) |
1141 | @@ -370,12 +371,32 @@ static int xlnx_formatter_pcm_open(struct snd_pcm_substream *substream) |
1142 | snd_soc_set_runtime_hwparams(substream, &xlnx_pcm_hardware); |
1143 | runtime->private_data = stream_data; |
1144 | |
1145 | - /* Resize the period size divisible by 64 */ |
1146 | + /* Resize the period bytes as divisible by 64 */ |
1147 | err = snd_pcm_hw_constraint_step(runtime, 0, |
1148 | - SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64); |
1149 | + SNDRV_PCM_HW_PARAM_PERIOD_BYTES, |
1150 | + XLNX_AUD_ALIGN_BYTES); |
1151 | if (err) { |
1152 | dev_err(component->dev, |
1153 | - "unable to set constraint on period bytes\n"); |
1154 | + "Unable to set constraint on period bytes\n"); |
1155 | + return err; |
1156 | + } |
1157 | + |
1158 | + /* Resize the buffer bytes as divisible by 64 */ |
1159 | + err = snd_pcm_hw_constraint_step(runtime, 0, |
1160 | + SNDRV_PCM_HW_PARAM_BUFFER_BYTES, |
1161 | + XLNX_AUD_ALIGN_BYTES); |
1162 | + if (err) { |
1163 | + dev_err(component->dev, |
1164 | + "Unable to set constraint on buffer bytes\n"); |
1165 | + return err; |
1166 | + } |
1167 | + |
1168 | + /* Set periods as integer multiple */ |
1169 | + err = snd_pcm_hw_constraint_integer(runtime, |
1170 | + SNDRV_PCM_HW_PARAM_PERIODS); |
1171 | + if (err < 0) { |
1172 | + dev_err(component->dev, |
1173 | + "Unable to set constraint on periods to be integer\n"); |
1174 | return err; |
1175 | } |
1176 | |
1177 | diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h |
1178 | index 01dee2074ab36..c29ccdf9e8bca 100644 |
1179 | --- a/sound/usb/quirks-table.h |
1180 | +++ b/sound/usb/quirks-table.h |
1181 | @@ -25,6 +25,16 @@ |
1182 | .idProduct = prod, \ |
1183 | .bInterfaceClass = USB_CLASS_VENDOR_SPEC |
1184 | |
1185 | +/* A standard entry matching with vid/pid and the audio class/subclass */ |
1186 | +#define USB_AUDIO_DEVICE(vend, prod) \ |
1187 | + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ |
1188 | + USB_DEVICE_ID_MATCH_INT_CLASS | \ |
1189 | + USB_DEVICE_ID_MATCH_INT_SUBCLASS, \ |
1190 | + .idVendor = vend, \ |
1191 | + .idProduct = prod, \ |
1192 | + .bInterfaceClass = USB_CLASS_AUDIO, \ |
1193 | + .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL |
1194 | + |
1195 | /* HP Thunderbolt Dock Audio Headset */ |
1196 | { |
1197 | USB_DEVICE(0x03f0, 0x0269), |
1198 | diff --git a/tools/testing/selftests/futex/Makefile b/tools/testing/selftests/futex/Makefile |
1199 | index 12631f0076a10..11e157d7533b8 100644 |
1200 | --- a/tools/testing/selftests/futex/Makefile |
1201 | +++ b/tools/testing/selftests/futex/Makefile |
1202 | @@ -11,7 +11,7 @@ all: |
1203 | @for DIR in $(SUBDIRS); do \ |
1204 | BUILD_TARGET=$(OUTPUT)/$$DIR; \ |
1205 | mkdir $$BUILD_TARGET -p; \ |
1206 | - make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ |
1207 | + $(MAKE) OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ |
1208 | if [ -e $$DIR/$(TEST_PROGS) ]; then \ |
1209 | rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/; \ |
1210 | fi \ |
1211 | @@ -32,6 +32,6 @@ override define CLEAN |
1212 | @for DIR in $(SUBDIRS); do \ |
1213 | BUILD_TARGET=$(OUTPUT)/$$DIR; \ |
1214 | mkdir $$BUILD_TARGET -p; \ |
1215 | - make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ |
1216 | + $(MAKE) OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ |
1217 | done |
1218 | endef |