Contents of /trunk/kernel-alx-legacy/patches-4.9/0353-4.9.254-all-fixes.patch
Parent Directory | Revision Log
Revision 3655 -
(show annotations)
(download)
Mon Oct 24 14:07:33 2022 UTC (23 months ago) by niro
File size: 19658 byte(s)
Mon Oct 24 14:07:33 2022 UTC (23 months ago) by niro
File size: 19658 byte(s)
-linux-4.9.254
1 | diff --git a/Makefile b/Makefile |
2 | index 62a07bdcfacb7..ea9ea119460d4 100644 |
3 | --- a/Makefile |
4 | +++ b/Makefile |
5 | @@ -1,6 +1,6 @@ |
6 | VERSION = 4 |
7 | PATCHLEVEL = 9 |
8 | -SUBLEVEL = 253 |
9 | +SUBLEVEL = 254 |
10 | EXTRAVERSION = |
11 | NAME = Roaring Lionus |
12 | |
13 | diff --git a/arch/sh/drivers/dma/Kconfig b/arch/sh/drivers/dma/Kconfig |
14 | index 78bc97b1d0270..ac834e9e0e0a4 100644 |
15 | --- a/arch/sh/drivers/dma/Kconfig |
16 | +++ b/arch/sh/drivers/dma/Kconfig |
17 | @@ -62,8 +62,7 @@ config PVR2_DMA |
18 | |
19 | config G2_DMA |
20 | tristate "G2 Bus DMA support" |
21 | - depends on SH_DREAMCAST |
22 | - select SH_DMA_API |
23 | + depends on SH_DREAMCAST && SH_DMA_API |
24 | help |
25 | This enables support for the DMA controller for the Dreamcast's |
26 | G2 bus. Drivers that want this will generally enable this on |
27 | diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile |
28 | index 89b163351e642..7be7acd6a5409 100644 |
29 | --- a/arch/x86/boot/compressed/Makefile |
30 | +++ b/arch/x86/boot/compressed/Makefile |
31 | @@ -35,6 +35,8 @@ KBUILD_CFLAGS += -mno-mmx -mno-sse |
32 | KBUILD_CFLAGS += $(call cc-option,-ffreestanding) |
33 | KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector) |
34 | KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) |
35 | +# Disable relocation relaxation in case the link is not PIE. |
36 | +KBUILD_CFLAGS += $(call as-option,-Wa$(comma)-mrelax-relocations=no) |
37 | |
38 | KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ |
39 | GCOV_PROFILE := n |
40 | diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c |
41 | index f49e2b7880ac2..5aa4a01f698fe 100644 |
42 | --- a/drivers/acpi/scan.c |
43 | +++ b/drivers/acpi/scan.c |
44 | @@ -585,6 +585,8 @@ static int acpi_get_device_data(acpi_handle handle, struct acpi_device **device, |
45 | if (!device) |
46 | return -EINVAL; |
47 | |
48 | + *device = NULL; |
49 | + |
50 | status = acpi_get_data_full(handle, acpi_scan_drop_device, |
51 | (void **)device, callback); |
52 | if (ACPI_FAILURE(status) || !*device) { |
53 | diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c |
54 | index 7deb81b6dbac6..4b571cc6bc70f 100644 |
55 | --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c |
56 | +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c |
57 | @@ -75,7 +75,7 @@ shadow_image(struct nvkm_bios *bios, int idx, u32 offset, struct shadow *mthd) |
58 | nvkm_debug(subdev, "%08x: type %02x, %d bytes\n", |
59 | image.base, image.type, image.size); |
60 | |
61 | - if (!shadow_fetch(bios, mthd, image.size)) { |
62 | + if (!shadow_fetch(bios, mthd, image.base + image.size)) { |
63 | nvkm_debug(subdev, "%08x: fetch failed\n", image.base); |
64 | return 0; |
65 | } |
66 | diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c |
67 | index a5783f4d972e3..c49795e779be4 100644 |
68 | --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c |
69 | +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c |
70 | @@ -33,7 +33,7 @@ static void |
71 | gm200_i2c_aux_fini(struct gm200_i2c_aux *aux) |
72 | { |
73 | struct nvkm_device *device = aux->base.pad->i2c->subdev.device; |
74 | - nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00310000, 0x00000000); |
75 | + nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00710000, 0x00000000); |
76 | } |
77 | |
78 | static int |
79 | @@ -54,10 +54,10 @@ gm200_i2c_aux_init(struct gm200_i2c_aux *aux) |
80 | AUX_ERR(&aux->base, "begin idle timeout %08x", ctrl); |
81 | return -EBUSY; |
82 | } |
83 | - } while (ctrl & 0x03010000); |
84 | + } while (ctrl & 0x07010000); |
85 | |
86 | /* set some magic, and wait up to 1ms for it to appear */ |
87 | - nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00300000, ureq); |
88 | + nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00700000, ureq); |
89 | timeout = 1000; |
90 | do { |
91 | ctrl = nvkm_rd32(device, 0x00d954 + (aux->ch * 0x50)); |
92 | @@ -67,7 +67,7 @@ gm200_i2c_aux_init(struct gm200_i2c_aux *aux) |
93 | gm200_i2c_aux_fini(aux); |
94 | return -EBUSY; |
95 | } |
96 | - } while ((ctrl & 0x03000000) != urep); |
97 | + } while ((ctrl & 0x07000000) != urep); |
98 | |
99 | return 0; |
100 | } |
101 | diff --git a/drivers/hwtracing/stm/heartbeat.c b/drivers/hwtracing/stm/heartbeat.c |
102 | index 3da7b673aab25..3957ce678265d 100644 |
103 | --- a/drivers/hwtracing/stm/heartbeat.c |
104 | +++ b/drivers/hwtracing/stm/heartbeat.c |
105 | @@ -72,7 +72,7 @@ static void stm_heartbeat_unlink(struct stm_source_data *data) |
106 | |
107 | static int stm_heartbeat_init(void) |
108 | { |
109 | - int i, ret = -ENOMEM; |
110 | + int i, ret; |
111 | |
112 | if (nr_devs < 0 || nr_devs > STM_HEARTBEAT_MAX) |
113 | return -EINVAL; |
114 | @@ -80,8 +80,10 @@ static int stm_heartbeat_init(void) |
115 | for (i = 0; i < nr_devs; i++) { |
116 | stm_heartbeat[i].data.name = |
117 | kasprintf(GFP_KERNEL, "heartbeat.%d", i); |
118 | - if (!stm_heartbeat[i].data.name) |
119 | + if (!stm_heartbeat[i].data.name) { |
120 | + ret = -ENOMEM; |
121 | goto fail_unregister; |
122 | + } |
123 | |
124 | stm_heartbeat[i].data.nr_chans = 1; |
125 | stm_heartbeat[i].data.link = stm_heartbeat_link; |
126 | diff --git a/drivers/i2c/busses/i2c-octeon-core.c b/drivers/i2c/busses/i2c-octeon-core.c |
127 | index 5e63b17f935d5..e5ad3f9cd372f 100644 |
128 | --- a/drivers/i2c/busses/i2c-octeon-core.c |
129 | +++ b/drivers/i2c/busses/i2c-octeon-core.c |
130 | @@ -383,7 +383,7 @@ static int octeon_i2c_read(struct octeon_i2c *i2c, int target, |
131 | |
132 | data[i] = octeon_i2c_data_read(i2c); |
133 | if (recv_len && i == 0) { |
134 | - if (data[i] > I2C_SMBUS_BLOCK_MAX + 1) |
135 | + if (data[i] > I2C_SMBUS_BLOCK_MAX) |
136 | return -EPROTO; |
137 | length += data[i]; |
138 | } |
139 | diff --git a/drivers/iio/dac/ad5504.c b/drivers/iio/dac/ad5504.c |
140 | index 788b3d6fd1cc9..b15a02f502df9 100644 |
141 | --- a/drivers/iio/dac/ad5504.c |
142 | +++ b/drivers/iio/dac/ad5504.c |
143 | @@ -189,9 +189,9 @@ static ssize_t ad5504_write_dac_powerdown(struct iio_dev *indio_dev, |
144 | return ret; |
145 | |
146 | if (pwr_down) |
147 | - st->pwr_down_mask |= (1 << chan->channel); |
148 | - else |
149 | st->pwr_down_mask &= ~(1 << chan->channel); |
150 | + else |
151 | + st->pwr_down_mask |= (1 << chan->channel); |
152 | |
153 | ret = ad5504_spi_write(st, AD5504_ADDR_CTRL, |
154 | AD5504_DAC_PWRDWN_MODE(st->pwr_down_mode) | |
155 | diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c |
156 | index 62e3dc19b6099..5d120c3cee57d 100644 |
157 | --- a/drivers/md/dm-table.c |
158 | +++ b/drivers/md/dm-table.c |
159 | @@ -396,14 +396,23 @@ int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode, |
160 | { |
161 | int r; |
162 | dev_t dev; |
163 | + unsigned int major, minor; |
164 | + char dummy; |
165 | struct dm_dev_internal *dd; |
166 | struct dm_table *t = ti->table; |
167 | |
168 | BUG_ON(!t); |
169 | |
170 | - dev = dm_get_dev_t(path); |
171 | - if (!dev) |
172 | - return -ENODEV; |
173 | + if (sscanf(path, "%u:%u%c", &major, &minor, &dummy) == 2) { |
174 | + /* Extract the major/minor numbers */ |
175 | + dev = MKDEV(major, minor); |
176 | + if (MAJOR(dev) != major || MINOR(dev) != minor) |
177 | + return -EOVERFLOW; |
178 | + } else { |
179 | + dev = dm_get_dev_t(path); |
180 | + if (!dev) |
181 | + return -ENODEV; |
182 | + } |
183 | |
184 | dd = find_device(&t->devices, dev); |
185 | if (!dd) { |
186 | diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c |
187 | index c7508d9a4c6fb..164078609f98e 100644 |
188 | --- a/drivers/net/can/dev.c |
189 | +++ b/drivers/net/can/dev.c |
190 | @@ -555,11 +555,11 @@ static void can_restart(struct net_device *dev) |
191 | } |
192 | cf->can_id |= CAN_ERR_RESTARTED; |
193 | |
194 | - netif_rx_ni(skb); |
195 | - |
196 | stats->rx_packets++; |
197 | stats->rx_bytes += cf->can_dlc; |
198 | |
199 | + netif_rx_ni(skb); |
200 | + |
201 | restart: |
202 | netdev_dbg(dev, "restarted\n"); |
203 | priv->can_stats.restarts++; |
204 | diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c |
205 | index c387be5c926b7..5ec0042bc3840 100644 |
206 | --- a/drivers/net/dsa/b53/b53_common.c |
207 | +++ b/drivers/net/dsa/b53/b53_common.c |
208 | @@ -946,7 +946,7 @@ static int b53_vlan_prepare(struct dsa_switch *ds, int port, |
209 | if ((is5325(dev) || is5365(dev)) && vlan->vid_begin == 0) |
210 | return -EOPNOTSUPP; |
211 | |
212 | - if (vlan->vid_end > dev->num_vlans) |
213 | + if (vlan->vid_end >= dev->num_vlans) |
214 | return -ERANGE; |
215 | |
216 | b53_enable_vlan(dev, true); |
217 | diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c |
218 | index 6f8d4810ce979..7458b1a70e5d6 100644 |
219 | --- a/drivers/net/ethernet/renesas/sh_eth.c |
220 | +++ b/drivers/net/ethernet/renesas/sh_eth.c |
221 | @@ -2411,10 +2411,10 @@ static int sh_eth_close(struct net_device *ndev) |
222 | /* Free all the skbuffs in the Rx queue and the DMA buffer. */ |
223 | sh_eth_ring_free(ndev); |
224 | |
225 | - pm_runtime_put_sync(&mdp->pdev->dev); |
226 | - |
227 | mdp->is_opened = 0; |
228 | |
229 | + pm_runtime_put(&mdp->pdev->dev); |
230 | + |
231 | return 0; |
232 | } |
233 | |
234 | diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c |
235 | index ad80e4223c2d3..a767d942bfca5 100644 |
236 | --- a/drivers/scsi/ufs/ufshcd.c |
237 | +++ b/drivers/scsi/ufs/ufshcd.c |
238 | @@ -4552,19 +4552,16 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd) |
239 | { |
240 | struct Scsi_Host *host; |
241 | struct ufs_hba *hba; |
242 | - unsigned int tag; |
243 | u32 pos; |
244 | int err; |
245 | - u8 resp = 0xF; |
246 | - struct ufshcd_lrb *lrbp; |
247 | + u8 resp = 0xF, lun; |
248 | unsigned long flags; |
249 | |
250 | host = cmd->device->host; |
251 | hba = shost_priv(host); |
252 | - tag = cmd->request->tag; |
253 | |
254 | - lrbp = &hba->lrb[tag]; |
255 | - err = ufshcd_issue_tm_cmd(hba, lrbp->lun, 0, UFS_LOGICAL_RESET, &resp); |
256 | + lun = ufshcd_scsi_to_upiu_lun(cmd->device->lun); |
257 | + err = ufshcd_issue_tm_cmd(hba, lun, 0, UFS_LOGICAL_RESET, &resp); |
258 | if (err || resp != UPIU_TASK_MANAGEMENT_FUNC_COMPL) { |
259 | if (!err) |
260 | err = resp; |
261 | @@ -4573,7 +4570,7 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd) |
262 | |
263 | /* clear the commands that were pending for corresponding LUN */ |
264 | for_each_set_bit(pos, &hba->outstanding_reqs, hba->nutrs) { |
265 | - if (hba->lrb[pos].lun == lrbp->lun) { |
266 | + if (hba->lrb[pos].lun == lun) { |
267 | err = ufshcd_clear_cmd(hba, pos); |
268 | if (err) |
269 | break; |
270 | diff --git a/drivers/usb/gadget/udc/bdc/Kconfig b/drivers/usb/gadget/udc/bdc/Kconfig |
271 | index 0d7b8c9f72fda..778df4badf888 100644 |
272 | --- a/drivers/usb/gadget/udc/bdc/Kconfig |
273 | +++ b/drivers/usb/gadget/udc/bdc/Kconfig |
274 | @@ -14,7 +14,7 @@ if USB_BDC_UDC |
275 | comment "Platform Support" |
276 | config USB_BDC_PCI |
277 | tristate "BDC support for PCIe based platforms" |
278 | - depends on PCI |
279 | + depends on PCI && BROKEN |
280 | default USB_BDC_UDC |
281 | help |
282 | Enable support for platforms which have BDC connected through PCIe, such as Lego3 FPGA platform. |
283 | diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c |
284 | index 99c7cf4822c33..34ad964d54d11 100644 |
285 | --- a/drivers/usb/gadget/udc/core.c |
286 | +++ b/drivers/usb/gadget/udc/core.c |
287 | @@ -1424,10 +1424,13 @@ static ssize_t usb_udc_softconn_store(struct device *dev, |
288 | struct device_attribute *attr, const char *buf, size_t n) |
289 | { |
290 | struct usb_udc *udc = container_of(dev, struct usb_udc, dev); |
291 | + ssize_t ret; |
292 | |
293 | + mutex_lock(&udc_lock); |
294 | if (!udc->driver) { |
295 | dev_err(dev, "soft-connect without a gadget driver\n"); |
296 | - return -EOPNOTSUPP; |
297 | + ret = -EOPNOTSUPP; |
298 | + goto out; |
299 | } |
300 | |
301 | if (sysfs_streq(buf, "connect")) { |
302 | @@ -1439,10 +1442,14 @@ static ssize_t usb_udc_softconn_store(struct device *dev, |
303 | usb_gadget_udc_stop(udc); |
304 | } else { |
305 | dev_err(dev, "unsupported command '%s'\n", buf); |
306 | - return -EINVAL; |
307 | + ret = -EINVAL; |
308 | + goto out; |
309 | } |
310 | |
311 | - return n; |
312 | + ret = n; |
313 | +out: |
314 | + mutex_unlock(&udc_lock); |
315 | + return ret; |
316 | } |
317 | static DEVICE_ATTR(soft_connect, S_IWUSR, NULL, usb_udc_softconn_store); |
318 | |
319 | diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c |
320 | index b3d6cc1a8021b..52c4176afae96 100644 |
321 | --- a/drivers/usb/host/ehci-hcd.c |
322 | +++ b/drivers/usb/host/ehci-hcd.c |
323 | @@ -587,6 +587,7 @@ static int ehci_run (struct usb_hcd *hcd) |
324 | struct ehci_hcd *ehci = hcd_to_ehci (hcd); |
325 | u32 temp; |
326 | u32 hcc_params; |
327 | + int rc; |
328 | |
329 | hcd->uses_new_polling = 1; |
330 | |
331 | @@ -642,9 +643,20 @@ static int ehci_run (struct usb_hcd *hcd) |
332 | down_write(&ehci_cf_port_reset_rwsem); |
333 | ehci->rh_state = EHCI_RH_RUNNING; |
334 | ehci_writel(ehci, FLAG_CF, &ehci->regs->configured_flag); |
335 | + |
336 | + /* Wait until HC become operational */ |
337 | ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */ |
338 | msleep(5); |
339 | + rc = ehci_handshake(ehci, &ehci->regs->status, STS_HALT, 0, 100 * 1000); |
340 | + |
341 | up_write(&ehci_cf_port_reset_rwsem); |
342 | + |
343 | + if (rc) { |
344 | + ehci_err(ehci, "USB %x.%x, controller refused to start: %d\n", |
345 | + ((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f), rc); |
346 | + return rc; |
347 | + } |
348 | + |
349 | ehci->last_periodic_enable = ktime_get_real(); |
350 | |
351 | temp = HC_VERSION(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase)); |
352 | diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c |
353 | index 3a3926ff7b857..643c427bb2773 100644 |
354 | --- a/drivers/usb/host/ehci-hub.c |
355 | +++ b/drivers/usb/host/ehci-hub.c |
356 | @@ -350,6 +350,9 @@ static int ehci_bus_suspend (struct usb_hcd *hcd) |
357 | |
358 | unlink_empty_async_suspended(ehci); |
359 | |
360 | + /* Some Synopsys controllers mistakenly leave IAA turned on */ |
361 | + ehci_writel(ehci, STS_IAA, &ehci->regs->status); |
362 | + |
363 | /* Any IAA cycle that started before the suspend is now invalid */ |
364 | end_iaa_cycle(ehci); |
365 | ehci_handle_start_intr_unlinks(ehci); |
366 | diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c |
367 | index 1468dca77facf..6e1d65fda97e0 100644 |
368 | --- a/drivers/usb/host/xhci-ring.c |
369 | +++ b/drivers/usb/host/xhci-ring.c |
370 | @@ -2851,6 +2851,8 @@ static void queue_trb(struct xhci_hcd *xhci, struct xhci_ring *ring, |
371 | trb->field[0] = cpu_to_le32(field1); |
372 | trb->field[1] = cpu_to_le32(field2); |
373 | trb->field[2] = cpu_to_le32(field3); |
374 | + /* make sure TRB is fully written before giving it to the controller */ |
375 | + wmb(); |
376 | trb->field[3] = cpu_to_le32(field4); |
377 | inc_enq(xhci, ring, more_trbs_coming); |
378 | } |
379 | diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c |
380 | index 97d57a94776ac..040c43097d558 100644 |
381 | --- a/drivers/usb/host/xhci-tegra.c |
382 | +++ b/drivers/usb/host/xhci-tegra.c |
383 | @@ -579,6 +579,13 @@ static void tegra_xusb_mbox_handle(struct tegra_xusb *tegra, |
384 | enable); |
385 | if (err < 0) |
386 | break; |
387 | + |
388 | + /* |
389 | + * wait 500us for LFPS detector to be disabled before |
390 | + * sending ACK |
391 | + */ |
392 | + if (!enable) |
393 | + usleep_range(500, 1000); |
394 | } |
395 | |
396 | if (err < 0) { |
397 | diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h |
398 | index 61650c1830d45..d830eddacdc60 100644 |
399 | --- a/include/linux/compiler-gcc.h |
400 | +++ b/include/linux/compiler-gcc.h |
401 | @@ -149,6 +149,12 @@ |
402 | |
403 | #if GCC_VERSION < 30200 |
404 | # error Sorry, your compiler is too old - please upgrade it. |
405 | +#elif defined(CONFIG_ARM64) && GCC_VERSION < 50100 && !defined(__clang__) |
406 | +/* |
407 | + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293 |
408 | + * https://lore.kernel.org/r/20210107111841.GN1551@shell.armlinux.org.uk |
409 | + */ |
410 | +# error Sorry, your version of GCC is too old - please use 5.1 or newer. |
411 | #endif |
412 | |
413 | #if GCC_VERSION < 30300 |
414 | diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c |
415 | index 335c00209f746..78bdfbefd996c 100644 |
416 | --- a/kernel/bpf/verifier.c |
417 | +++ b/kernel/bpf/verifier.c |
418 | @@ -1732,12 +1732,11 @@ static void adjust_reg_min_max_vals(struct bpf_verifier_env *env, |
419 | * unsigned shift, so make the appropriate casts. |
420 | */ |
421 | if (min_val < 0 || dst_reg->min_value < 0) |
422 | - dst_reg->min_value = BPF_REGISTER_MIN_RANGE; |
423 | + reset_reg_range_values(regs, insn->dst_reg); |
424 | else |
425 | - dst_reg->min_value = |
426 | - (u64)(dst_reg->min_value) >> min_val; |
427 | + dst_reg->min_value = (u64)(dst_reg->min_value) >> max_val; |
428 | if (dst_reg->max_value != BPF_REGISTER_MAX_RANGE) |
429 | - dst_reg->max_value >>= max_val; |
430 | + dst_reg->max_value >>= min_val; |
431 | break; |
432 | default: |
433 | reset_reg_range_values(regs, insn->dst_reg); |
434 | diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c |
435 | index 55f60d2edc3fb..4ec8bf634f89f 100644 |
436 | --- a/kernel/trace/ring_buffer.c |
437 | +++ b/kernel/trace/ring_buffer.c |
438 | @@ -4289,6 +4289,8 @@ void ring_buffer_reset_cpu(struct ring_buffer *buffer, int cpu) |
439 | |
440 | if (!cpumask_test_cpu(cpu, buffer->cpumask)) |
441 | return; |
442 | + /* prevent another thread from changing buffer sizes */ |
443 | + mutex_lock(&buffer->mutex); |
444 | |
445 | atomic_inc(&buffer->resize_disabled); |
446 | atomic_inc(&cpu_buffer->record_disabled); |
447 | @@ -4312,6 +4314,8 @@ void ring_buffer_reset_cpu(struct ring_buffer *buffer, int cpu) |
448 | |
449 | atomic_dec(&cpu_buffer->record_disabled); |
450 | atomic_dec(&buffer->resize_disabled); |
451 | + |
452 | + mutex_unlock(&buffer->mutex); |
453 | } |
454 | EXPORT_SYMBOL_GPL(ring_buffer_reset_cpu); |
455 | |
456 | diff --git a/mm/slub.c b/mm/slub.c |
457 | index 7ccfc043c28e2..5c48a8a0524a2 100644 |
458 | --- a/mm/slub.c |
459 | +++ b/mm/slub.c |
460 | @@ -5648,10 +5648,8 @@ static int sysfs_slab_add(struct kmem_cache *s) |
461 | |
462 | s->kobj.kset = cache_kset(s); |
463 | err = kobject_init_and_add(&s->kobj, &slab_ktype, NULL, "%s", name); |
464 | - if (err) { |
465 | - kobject_put(&s->kobj); |
466 | + if (err) |
467 | goto out; |
468 | - } |
469 | |
470 | err = sysfs_create_group(&s->kobj, &slab_attr_group); |
471 | if (err) |
472 | diff --git a/net/core/skbuff.c b/net/core/skbuff.c |
473 | index 5582a4ed7c2fb..79034fb861b52 100644 |
474 | --- a/net/core/skbuff.c |
475 | +++ b/net/core/skbuff.c |
476 | @@ -428,7 +428,11 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int len, |
477 | |
478 | len += NET_SKB_PAD; |
479 | |
480 | - if ((len > SKB_WITH_OVERHEAD(PAGE_SIZE)) || |
481 | + /* If requested length is either too small or too big, |
482 | + * we use kmalloc() for skb->head allocation. |
483 | + */ |
484 | + if (len <= SKB_WITH_OVERHEAD(1024) || |
485 | + len > SKB_WITH_OVERHEAD(PAGE_SIZE) || |
486 | (gfp_mask & (__GFP_DIRECT_RECLAIM | GFP_DMA))) { |
487 | skb = __alloc_skb(len, gfp_mask, SKB_ALLOC_RX, NUMA_NO_NODE); |
488 | if (!skb) |
489 | diff --git a/net/ipv4/netfilter/ipt_rpfilter.c b/net/ipv4/netfilter/ipt_rpfilter.c |
490 | index 78cc64eddfc18..32a363465e0a4 100644 |
491 | --- a/net/ipv4/netfilter/ipt_rpfilter.c |
492 | +++ b/net/ipv4/netfilter/ipt_rpfilter.c |
493 | @@ -92,7 +92,7 @@ static bool rpfilter_mt(const struct sk_buff *skb, struct xt_action_param *par) |
494 | flow.saddr = rpfilter_get_saddr(iph->daddr); |
495 | flow.flowi4_oif = 0; |
496 | flow.flowi4_mark = info->flags & XT_RPFILTER_VALID_MARK ? skb->mark : 0; |
497 | - flow.flowi4_tos = RT_TOS(iph->tos); |
498 | + flow.flowi4_tos = iph->tos & IPTOS_RT_MASK; |
499 | flow.flowi4_scope = RT_SCOPE_UNIVERSE; |
500 | |
501 | return rpfilter_lookup_reverse(par->net, &flow, par->in, info->flags) ^ invert; |
502 | diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c |
503 | index a4c00242a90b3..6119ab33a56ea 100644 |
504 | --- a/net/ipv6/addrconf.c |
505 | +++ b/net/ipv6/addrconf.c |
506 | @@ -2285,6 +2285,7 @@ static void addrconf_add_mroute(struct net_device *dev) |
507 | .fc_dst_len = 8, |
508 | .fc_flags = RTF_UP, |
509 | .fc_nlinfo.nl_net = dev_net(dev), |
510 | + .fc_protocol = RTPROT_KERNEL, |
511 | }; |
512 | |
513 | ipv6_addr_set(&cfg.fc_dst, htonl(0xFF000000), 0, 0, 0); |
514 | diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c |
515 | index ab66e2b38e662..70ee78d8f8fb8 100644 |
516 | --- a/net/sched/cls_tcindex.c |
517 | +++ b/net/sched/cls_tcindex.c |
518 | @@ -307,9 +307,13 @@ tcindex_set_parms(struct net *net, struct tcf_proto *tp, unsigned long base, |
519 | if (tb[TCA_TCINDEX_MASK]) |
520 | cp->mask = nla_get_u16(tb[TCA_TCINDEX_MASK]); |
521 | |
522 | - if (tb[TCA_TCINDEX_SHIFT]) |
523 | + if (tb[TCA_TCINDEX_SHIFT]) { |
524 | cp->shift = nla_get_u32(tb[TCA_TCINDEX_SHIFT]); |
525 | - |
526 | + if (cp->shift > 16) { |
527 | + err = -EINVAL; |
528 | + goto errout; |
529 | + } |
530 | + } |
531 | if (!cp->hash) { |
532 | /* Hash not specified, use perfect hash if the upper limit |
533 | * of the hashing index is below the threshold. |
534 | diff --git a/sound/core/seq/oss/seq_oss_synth.c b/sound/core/seq/oss/seq_oss_synth.c |
535 | index c939459172353..247b68790a522 100644 |
536 | --- a/sound/core/seq/oss/seq_oss_synth.c |
537 | +++ b/sound/core/seq/oss/seq_oss_synth.c |
538 | @@ -624,7 +624,8 @@ snd_seq_oss_synth_make_info(struct seq_oss_devinfo *dp, int dev, struct synth_in |
539 | |
540 | if (info->is_midi) { |
541 | struct midi_info minf; |
542 | - snd_seq_oss_midi_make_info(dp, info->midi_mapped, &minf); |
543 | + if (snd_seq_oss_midi_make_info(dp, info->midi_mapped, &minf)) |
544 | + return -ENXIO; |
545 | inf->synth_type = SYNTH_TYPE_MIDI; |
546 | inf->synth_subtype = 0; |
547 | inf->nr_voices = 16; |
548 | diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c |
549 | index fc30d1e8aa76a..9dd104c308e1d 100644 |
550 | --- a/sound/pci/hda/patch_via.c |
551 | +++ b/sound/pci/hda/patch_via.c |
552 | @@ -135,6 +135,7 @@ static struct via_spec *via_new_spec(struct hda_codec *codec) |
553 | spec->codec_type = VT1708S; |
554 | spec->gen.indep_hp = 1; |
555 | spec->gen.keep_eapd_on = 1; |
556 | + spec->gen.dac_min_mute = 1; |
557 | spec->gen.pcm_playback_hook = via_playback_pcm_hook; |
558 | spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO; |
559 | codec->power_save_node = 1; |
560 | diff --git a/sound/soc/intel/boards/haswell.c b/sound/soc/intel/boards/haswell.c |
561 | index 11d0cc2b0e390..060da95770416 100644 |
562 | --- a/sound/soc/intel/boards/haswell.c |
563 | +++ b/sound/soc/intel/boards/haswell.c |
564 | @@ -197,6 +197,7 @@ static struct platform_driver haswell_audio = { |
565 | .probe = haswell_audio_probe, |
566 | .driver = { |
567 | .name = "haswell-audio", |
568 | + .pm = &snd_soc_pm_ops, |
569 | }, |
570 | }; |
571 |