Contents of /trunk/kernel-alx-legacy/patches-4.9/0274-4.9.175-all-fixes.patch
Parent Directory | Revision Log
Revision 3608 -
(show annotations)
(download)
Fri Aug 14 07:34:29 2020 UTC (4 years, 1 month ago) by niro
File size: 25218 byte(s)
Fri Aug 14 07:34:29 2020 UTC (4 years, 1 month ago) by niro
File size: 25218 byte(s)
-added kerenl-alx-legacy pkg
1 | diff --git a/Makefile b/Makefile |
2 | index f5836837df15..e52b0579e176 100644 |
3 | --- a/Makefile |
4 | +++ b/Makefile |
5 | @@ -1,6 +1,6 @@ |
6 | VERSION = 4 |
7 | PATCHLEVEL = 9 |
8 | -SUBLEVEL = 174 |
9 | +SUBLEVEL = 175 |
10 | EXTRAVERSION = |
11 | NAME = Roaring Lionus |
12 | |
13 | diff --git a/arch/arm/boot/compressed/efi-header.S b/arch/arm/boot/compressed/efi-header.S |
14 | index 3f7d1b74c5e0..a17ca8d78656 100644 |
15 | --- a/arch/arm/boot/compressed/efi-header.S |
16 | +++ b/arch/arm/boot/compressed/efi-header.S |
17 | @@ -17,7 +17,8 @@ |
18 | @ there. |
19 | .inst 'M' | ('Z' << 8) | (0x1310 << 16) @ tstne r0, #0x4d000 |
20 | #else |
21 | - W(mov) r0, r0 |
22 | + AR_CLASS( mov r0, r0 ) |
23 | + M_CLASS( nop.w ) |
24 | #endif |
25 | .endm |
26 | |
27 | diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c |
28 | index 098ab775135f..a30829052a00 100644 |
29 | --- a/arch/x86/events/intel/core.c |
30 | +++ b/arch/x86/events/intel/core.c |
31 | @@ -2867,7 +2867,7 @@ static int intel_pmu_hw_config(struct perf_event *event) |
32 | return ret; |
33 | |
34 | if (event->attr.precise_ip) { |
35 | - if (!event->attr.freq) { |
36 | + if (!(event->attr.freq || event->attr.wakeup_events)) { |
37 | event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD; |
38 | if (!(event->attr.sample_type & |
39 | ~intel_pmu_free_running_flags(event))) |
40 | diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c |
41 | index 10332c24f961..44ef1d66caa6 100644 |
42 | --- a/drivers/block/virtio_blk.c |
43 | +++ b/drivers/block/virtio_blk.c |
44 | @@ -392,6 +392,8 @@ static int init_vq(struct virtio_blk *vblk) |
45 | if (err) |
46 | num_vqs = 1; |
47 | |
48 | + num_vqs = min_t(unsigned int, nr_cpu_ids, num_vqs); |
49 | + |
50 | vblk->vqs = kmalloc_array(num_vqs, sizeof(*vblk->vqs), GFP_KERNEL); |
51 | if (!vblk->vqs) |
52 | return -ENOMEM; |
53 | diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c |
54 | index 863d030786e5..e7a6651ceeab 100644 |
55 | --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c |
56 | +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c |
57 | @@ -1473,7 +1473,6 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, |
58 | if (IS_ERR(regmap)) |
59 | ret = PTR_ERR(regmap); |
60 | if (ret) { |
61 | - ret = PTR_ERR(regmap); |
62 | dev_err(dev, |
63 | "Failed to get system configuration registers: %d\n", |
64 | ret); |
65 | @@ -1529,6 +1528,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, |
66 | of_node_put(remote); |
67 | |
68 | hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np); |
69 | + of_node_put(i2c_np); |
70 | if (!hdmi->ddc_adpt) { |
71 | dev_err(dev, "Failed to get ddc i2c adapter by node\n"); |
72 | return -EINVAL; |
73 | diff --git a/drivers/infiniband/hw/hfi1/rc.c b/drivers/infiniband/hw/hfi1/rc.c |
74 | index e8e0fa58cb71..b08786614c1b 100644 |
75 | --- a/drivers/infiniband/hw/hfi1/rc.c |
76 | +++ b/drivers/infiniband/hw/hfi1/rc.c |
77 | @@ -2394,7 +2394,7 @@ send_last: |
78 | update_ack_queue(qp, next); |
79 | } |
80 | e = &qp->s_ack_queue[qp->r_head_ack_queue]; |
81 | - if (e->opcode == OP(RDMA_READ_REQUEST) && e->rdma_sge.mr) { |
82 | + if (e->rdma_sge.mr) { |
83 | rvt_put_mr(e->rdma_sge.mr); |
84 | e->rdma_sge.mr = NULL; |
85 | } |
86 | @@ -2469,7 +2469,7 @@ send_last: |
87 | update_ack_queue(qp, next); |
88 | } |
89 | e = &qp->s_ack_queue[qp->r_head_ack_queue]; |
90 | - if (e->opcode == OP(RDMA_READ_REQUEST) && e->rdma_sge.mr) { |
91 | + if (e->rdma_sge.mr) { |
92 | rvt_put_mr(e->rdma_sge.mr); |
93 | e->rdma_sge.mr = NULL; |
94 | } |
95 | diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c |
96 | index 157e93421fb8..13bbe5795e4e 100644 |
97 | --- a/drivers/iommu/amd_iommu_init.c |
98 | +++ b/drivers/iommu/amd_iommu_init.c |
99 | @@ -318,7 +318,7 @@ static void iommu_write_l2(struct amd_iommu *iommu, u8 address, u32 val) |
100 | static void iommu_set_exclusion_range(struct amd_iommu *iommu) |
101 | { |
102 | u64 start = iommu->exclusion_start & PAGE_MASK; |
103 | - u64 limit = (start + iommu->exclusion_length) & PAGE_MASK; |
104 | + u64 limit = (start + iommu->exclusion_length - 1) & PAGE_MASK; |
105 | u64 entry; |
106 | |
107 | if (!iommu->exclusion_start) |
108 | diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c |
109 | index 89a52b941ea8..894d97e4ace5 100644 |
110 | --- a/drivers/scsi/csiostor/csio_scsi.c |
111 | +++ b/drivers/scsi/csiostor/csio_scsi.c |
112 | @@ -1713,8 +1713,11 @@ csio_scsi_err_handler(struct csio_hw *hw, struct csio_ioreq *req) |
113 | } |
114 | |
115 | out: |
116 | - if (req->nsge > 0) |
117 | + if (req->nsge > 0) { |
118 | scsi_dma_unmap(cmnd); |
119 | + if (req->dcopy && (host_status == DID_OK)) |
120 | + host_status = csio_scsi_copy_to_sgl(hw, req); |
121 | + } |
122 | |
123 | cmnd->result = (((host_status) << 16) | scsi_status); |
124 | cmnd->scsi_done(cmnd); |
125 | diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c |
126 | index 7be581f7c35d..1a6f65db615e 100644 |
127 | --- a/drivers/scsi/libsas/sas_expander.c |
128 | +++ b/drivers/scsi/libsas/sas_expander.c |
129 | @@ -47,17 +47,16 @@ static void smp_task_timedout(unsigned long _task) |
130 | unsigned long flags; |
131 | |
132 | spin_lock_irqsave(&task->task_state_lock, flags); |
133 | - if (!(task->task_state_flags & SAS_TASK_STATE_DONE)) |
134 | + if (!(task->task_state_flags & SAS_TASK_STATE_DONE)) { |
135 | task->task_state_flags |= SAS_TASK_STATE_ABORTED; |
136 | + complete(&task->slow_task->completion); |
137 | + } |
138 | spin_unlock_irqrestore(&task->task_state_lock, flags); |
139 | - |
140 | - complete(&task->slow_task->completion); |
141 | } |
142 | |
143 | static void smp_task_done(struct sas_task *task) |
144 | { |
145 | - if (!del_timer(&task->slow_task->timer)) |
146 | - return; |
147 | + del_timer(&task->slow_task->timer); |
148 | complete(&task->slow_task->completion); |
149 | } |
150 | |
151 | diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c |
152 | index 9a34afcb1c4c..5c3dfd92ea02 100644 |
153 | --- a/drivers/scsi/qla2xxx/qla_attr.c |
154 | +++ b/drivers/scsi/qla2xxx/qla_attr.c |
155 | @@ -345,7 +345,7 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj, |
156 | } |
157 | |
158 | ha->optrom_region_start = start; |
159 | - ha->optrom_region_size = start + size; |
160 | + ha->optrom_region_size = size; |
161 | |
162 | ha->optrom_state = QLA_SREADING; |
163 | ha->optrom_buffer = vmalloc(ha->optrom_region_size); |
164 | @@ -418,7 +418,7 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj, |
165 | } |
166 | |
167 | ha->optrom_region_start = start; |
168 | - ha->optrom_region_size = start + size; |
169 | + ha->optrom_region_size = size; |
170 | |
171 | ha->optrom_state = QLA_SWRITING; |
172 | ha->optrom_buffer = vmalloc(ha->optrom_region_size); |
173 | diff --git a/drivers/staging/greybus/power_supply.c b/drivers/staging/greybus/power_supply.c |
174 | index e85c988b7034..adea629b8065 100644 |
175 | --- a/drivers/staging/greybus/power_supply.c |
176 | +++ b/drivers/staging/greybus/power_supply.c |
177 | @@ -521,7 +521,7 @@ static int gb_power_supply_prop_descriptors_get(struct gb_power_supply *gbpsy) |
178 | |
179 | op = gb_operation_create(connection, |
180 | GB_POWER_SUPPLY_TYPE_GET_PROP_DESCRIPTORS, |
181 | - sizeof(req), sizeof(*resp) + props_count * |
182 | + sizeof(*req), sizeof(*resp) + props_count * |
183 | sizeof(struct gb_power_supply_props_desc), |
184 | GFP_KERNEL); |
185 | if (!op) |
186 | diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c |
187 | index 1e91b803ee4e..73dc5a6c6108 100644 |
188 | --- a/drivers/usb/dwc3/core.c |
189 | +++ b/drivers/usb/dwc3/core.c |
190 | @@ -991,7 +991,7 @@ static int dwc3_probe(struct platform_device *pdev) |
191 | dwc->regs_size = resource_size(res); |
192 | |
193 | /* default to highest possible threshold */ |
194 | - lpm_nyet_threshold = 0xff; |
195 | + lpm_nyet_threshold = 0xf; |
196 | |
197 | /* default to -3.5dB de-emphasis */ |
198 | tx_de_emphasis = 1; |
199 | diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c |
200 | index 972f5a5fe577..1f20fa0a67c0 100644 |
201 | --- a/drivers/usb/serial/f81232.c |
202 | +++ b/drivers/usb/serial/f81232.c |
203 | @@ -560,9 +560,12 @@ static int f81232_open(struct tty_struct *tty, struct usb_serial_port *port) |
204 | |
205 | static void f81232_close(struct usb_serial_port *port) |
206 | { |
207 | + struct f81232_private *port_priv = usb_get_serial_port_data(port); |
208 | + |
209 | f81232_port_disable(port); |
210 | usb_serial_generic_close(port); |
211 | usb_kill_urb(port->interrupt_in_urb); |
212 | + flush_work(&port_priv->interrupt_work); |
213 | } |
214 | |
215 | static void f81232_dtr_rts(struct usb_serial_port *port, int on) |
216 | @@ -656,6 +659,40 @@ static int f81232_port_remove(struct usb_serial_port *port) |
217 | return 0; |
218 | } |
219 | |
220 | +static int f81232_suspend(struct usb_serial *serial, pm_message_t message) |
221 | +{ |
222 | + struct usb_serial_port *port = serial->port[0]; |
223 | + struct f81232_private *port_priv = usb_get_serial_port_data(port); |
224 | + int i; |
225 | + |
226 | + for (i = 0; i < ARRAY_SIZE(port->read_urbs); ++i) |
227 | + usb_kill_urb(port->read_urbs[i]); |
228 | + |
229 | + usb_kill_urb(port->interrupt_in_urb); |
230 | + |
231 | + if (port_priv) |
232 | + flush_work(&port_priv->interrupt_work); |
233 | + |
234 | + return 0; |
235 | +} |
236 | + |
237 | +static int f81232_resume(struct usb_serial *serial) |
238 | +{ |
239 | + struct usb_serial_port *port = serial->port[0]; |
240 | + int result; |
241 | + |
242 | + if (tty_port_initialized(&port->port)) { |
243 | + result = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO); |
244 | + if (result) { |
245 | + dev_err(&port->dev, "submit interrupt urb failed: %d\n", |
246 | + result); |
247 | + return result; |
248 | + } |
249 | + } |
250 | + |
251 | + return usb_serial_generic_resume(serial); |
252 | +} |
253 | + |
254 | static struct usb_serial_driver f81232_device = { |
255 | .driver = { |
256 | .owner = THIS_MODULE, |
257 | @@ -679,6 +716,8 @@ static struct usb_serial_driver f81232_device = { |
258 | .read_int_callback = f81232_read_int_callback, |
259 | .port_probe = f81232_port_probe, |
260 | .port_remove = f81232_port_remove, |
261 | + .suspend = f81232_suspend, |
262 | + .resume = f81232_resume, |
263 | }; |
264 | |
265 | static struct usb_serial_driver * const serial_drivers[] = { |
266 | diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c |
267 | index 13f2c051dbf2..afb4b0bf47b3 100644 |
268 | --- a/drivers/usb/storage/scsiglue.c |
269 | +++ b/drivers/usb/storage/scsiglue.c |
270 | @@ -81,6 +81,7 @@ static const char* host_info(struct Scsi_Host *host) |
271 | static int slave_alloc (struct scsi_device *sdev) |
272 | { |
273 | struct us_data *us = host_to_us(sdev->host); |
274 | + int maxp; |
275 | |
276 | /* |
277 | * Set the INQUIRY transfer length to 36. We don't use any of |
278 | @@ -90,20 +91,17 @@ static int slave_alloc (struct scsi_device *sdev) |
279 | sdev->inquiry_len = 36; |
280 | |
281 | /* |
282 | - * USB has unusual DMA-alignment requirements: Although the |
283 | - * starting address of each scatter-gather element doesn't matter, |
284 | - * the length of each element except the last must be divisible |
285 | - * by the Bulk maxpacket value. There's currently no way to |
286 | - * express this by block-layer constraints, so we'll cop out |
287 | - * and simply require addresses to be aligned at 512-byte |
288 | - * boundaries. This is okay since most block I/O involves |
289 | - * hardware sectors that are multiples of 512 bytes in length, |
290 | - * and since host controllers up through USB 2.0 have maxpacket |
291 | - * values no larger than 512. |
292 | - * |
293 | - * But it doesn't suffice for Wireless USB, where Bulk maxpacket |
294 | - * values can be as large as 2048. To make that work properly |
295 | - * will require changes to the block layer. |
296 | + * USB has unusual scatter-gather requirements: the length of each |
297 | + * scatterlist element except the last must be divisible by the |
298 | + * Bulk maxpacket value. Fortunately this value is always a |
299 | + * power of 2. Inform the block layer about this requirement. |
300 | + */ |
301 | + maxp = usb_maxpacket(us->pusb_dev, us->recv_bulk_pipe, 0); |
302 | + blk_queue_virt_boundary(sdev->request_queue, maxp - 1); |
303 | + |
304 | + /* |
305 | + * Some host controllers may have alignment requirements. |
306 | + * We'll play it safe by requiring 512-byte alignment always. |
307 | */ |
308 | blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1)); |
309 | |
310 | diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c |
311 | index 64af88977b03..97621e5bdad7 100644 |
312 | --- a/drivers/usb/storage/uas.c |
313 | +++ b/drivers/usb/storage/uas.c |
314 | @@ -796,24 +796,33 @@ static int uas_slave_alloc(struct scsi_device *sdev) |
315 | { |
316 | struct uas_dev_info *devinfo = |
317 | (struct uas_dev_info *)sdev->host->hostdata; |
318 | + int maxp; |
319 | |
320 | sdev->hostdata = devinfo; |
321 | |
322 | /* |
323 | - * USB has unusual DMA-alignment requirements: Although the |
324 | - * starting address of each scatter-gather element doesn't matter, |
325 | - * the length of each element except the last must be divisible |
326 | - * by the Bulk maxpacket value. There's currently no way to |
327 | - * express this by block-layer constraints, so we'll cop out |
328 | - * and simply require addresses to be aligned at 512-byte |
329 | - * boundaries. This is okay since most block I/O involves |
330 | - * hardware sectors that are multiples of 512 bytes in length, |
331 | - * and since host controllers up through USB 2.0 have maxpacket |
332 | - * values no larger than 512. |
333 | + * We have two requirements here. We must satisfy the requirements |
334 | + * of the physical HC and the demands of the protocol, as we |
335 | + * definitely want no additional memory allocation in this path |
336 | + * ruling out using bounce buffers. |
337 | * |
338 | - * But it doesn't suffice for Wireless USB, where Bulk maxpacket |
339 | - * values can be as large as 2048. To make that work properly |
340 | - * will require changes to the block layer. |
341 | + * For a transmission on USB to continue we must never send |
342 | + * a package that is smaller than maxpacket. Hence the length of each |
343 | + * scatterlist element except the last must be divisible by the |
344 | + * Bulk maxpacket value. |
345 | + * If the HC does not ensure that through SG, |
346 | + * the upper layer must do that. We must assume nothing |
347 | + * about the capabilities off the HC, so we use the most |
348 | + * pessimistic requirement. |
349 | + */ |
350 | + |
351 | + maxp = usb_maxpacket(devinfo->udev, devinfo->data_in_pipe, 0); |
352 | + blk_queue_virt_boundary(sdev->request_queue, maxp - 1); |
353 | + |
354 | + /* |
355 | + * The protocol has no requirements on alignment in the strict sense. |
356 | + * Controllers may or may not have alignment restrictions. |
357 | + * As this is not exported, we use an extremely conservative guess. |
358 | */ |
359 | blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1)); |
360 | |
361 | diff --git a/include/linux/kernel.h b/include/linux/kernel.h |
362 | index 61054f12be7c..d83fc669eeac 100644 |
363 | --- a/include/linux/kernel.h |
364 | +++ b/include/linux/kernel.h |
365 | @@ -55,8 +55,8 @@ |
366 | |
367 | #define u64_to_user_ptr(x) ( \ |
368 | { \ |
369 | - typecheck(u64, x); \ |
370 | - (void __user *)(uintptr_t)x; \ |
371 | + typecheck(u64, (x)); \ |
372 | + (void __user *)(uintptr_t)(x); \ |
373 | } \ |
374 | ) |
375 | |
376 | diff --git a/include/linux/mm.h b/include/linux/mm.h |
377 | index 11a5a46ce72b..e3c8d40a18b5 100644 |
378 | --- a/include/linux/mm.h |
379 | +++ b/include/linux/mm.h |
380 | @@ -777,6 +777,15 @@ static inline void get_page(struct page *page) |
381 | get_zone_device_page(page); |
382 | } |
383 | |
384 | +static inline __must_check bool try_get_page(struct page *page) |
385 | +{ |
386 | + page = compound_head(page); |
387 | + if (WARN_ON_ONCE(page_ref_count(page) <= 0)) |
388 | + return false; |
389 | + page_ref_inc(page); |
390 | + return true; |
391 | +} |
392 | + |
393 | static inline void put_page(struct page *page) |
394 | { |
395 | page = compound_head(page); |
396 | diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h |
397 | index 4931787193c3..57a7dba49d29 100644 |
398 | --- a/include/net/bluetooth/hci_core.h |
399 | +++ b/include/net/bluetooth/hci_core.h |
400 | @@ -176,6 +176,9 @@ struct adv_info { |
401 | |
402 | #define HCI_MAX_SHORT_NAME_LENGTH 10 |
403 | |
404 | +/* Min encryption key size to match with SMP */ |
405 | +#define HCI_MIN_ENC_KEY_SIZE 7 |
406 | + |
407 | /* Default LE RPA expiry time, 15 minutes */ |
408 | #define HCI_DEFAULT_RPA_TIMEOUT (15 * 60) |
409 | |
410 | diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c |
411 | index cf94460504bb..be7f489788e2 100644 |
412 | --- a/kernel/irq/manage.c |
413 | +++ b/kernel/irq/manage.c |
414 | @@ -332,8 +332,10 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify) |
415 | desc->affinity_notify = notify; |
416 | raw_spin_unlock_irqrestore(&desc->lock, flags); |
417 | |
418 | - if (old_notify) |
419 | + if (old_notify) { |
420 | + cancel_work_sync(&old_notify->work); |
421 | kref_put(&old_notify->kref, old_notify->release); |
422 | + } |
423 | |
424 | return 0; |
425 | } |
426 | diff --git a/kernel/time/timer_stats.c b/kernel/time/timer_stats.c |
427 | index 087204c733eb..c74920f318c5 100644 |
428 | --- a/kernel/time/timer_stats.c |
429 | +++ b/kernel/time/timer_stats.c |
430 | @@ -417,7 +417,7 @@ static int __init init_tstats_procfs(void) |
431 | { |
432 | struct proc_dir_entry *pe; |
433 | |
434 | - pe = proc_create("timer_stats", 0644, NULL, &tstats_fops); |
435 | + pe = proc_create("timer_stats", 0600, NULL, &tstats_fops); |
436 | if (!pe) |
437 | return -ENOMEM; |
438 | return 0; |
439 | diff --git a/lib/ubsan.c b/lib/ubsan.c |
440 | index 60e108c5c173..c652b4a820cc 100644 |
441 | --- a/lib/ubsan.c |
442 | +++ b/lib/ubsan.c |
443 | @@ -86,11 +86,13 @@ static bool is_inline_int(struct type_descriptor *type) |
444 | return bits <= inline_bits; |
445 | } |
446 | |
447 | -static s_max get_signed_val(struct type_descriptor *type, unsigned long val) |
448 | +static s_max get_signed_val(struct type_descriptor *type, void *val) |
449 | { |
450 | if (is_inline_int(type)) { |
451 | unsigned extra_bits = sizeof(s_max)*8 - type_bit_width(type); |
452 | - return ((s_max)val) << extra_bits >> extra_bits; |
453 | + unsigned long ulong_val = (unsigned long)val; |
454 | + |
455 | + return ((s_max)ulong_val) << extra_bits >> extra_bits; |
456 | } |
457 | |
458 | if (type_bit_width(type) == 64) |
459 | @@ -99,15 +101,15 @@ static s_max get_signed_val(struct type_descriptor *type, unsigned long val) |
460 | return *(s_max *)val; |
461 | } |
462 | |
463 | -static bool val_is_negative(struct type_descriptor *type, unsigned long val) |
464 | +static bool val_is_negative(struct type_descriptor *type, void *val) |
465 | { |
466 | return type_is_signed(type) && get_signed_val(type, val) < 0; |
467 | } |
468 | |
469 | -static u_max get_unsigned_val(struct type_descriptor *type, unsigned long val) |
470 | +static u_max get_unsigned_val(struct type_descriptor *type, void *val) |
471 | { |
472 | if (is_inline_int(type)) |
473 | - return val; |
474 | + return (unsigned long)val; |
475 | |
476 | if (type_bit_width(type) == 64) |
477 | return *(u64 *)val; |
478 | @@ -116,7 +118,7 @@ static u_max get_unsigned_val(struct type_descriptor *type, unsigned long val) |
479 | } |
480 | |
481 | static void val_to_string(char *str, size_t size, struct type_descriptor *type, |
482 | - unsigned long value) |
483 | + void *value) |
484 | { |
485 | if (type_is_int(type)) { |
486 | if (type_bit_width(type) == 128) { |
487 | @@ -168,8 +170,8 @@ static void ubsan_epilogue(unsigned long *flags) |
488 | current->in_ubsan--; |
489 | } |
490 | |
491 | -static void handle_overflow(struct overflow_data *data, unsigned long lhs, |
492 | - unsigned long rhs, char op) |
493 | +static void handle_overflow(struct overflow_data *data, void *lhs, |
494 | + void *rhs, char op) |
495 | { |
496 | |
497 | struct type_descriptor *type = data->type; |
498 | @@ -196,8 +198,7 @@ static void handle_overflow(struct overflow_data *data, unsigned long lhs, |
499 | } |
500 | |
501 | void __ubsan_handle_add_overflow(struct overflow_data *data, |
502 | - unsigned long lhs, |
503 | - unsigned long rhs) |
504 | + void *lhs, void *rhs) |
505 | { |
506 | |
507 | handle_overflow(data, lhs, rhs, '+'); |
508 | @@ -205,23 +206,21 @@ void __ubsan_handle_add_overflow(struct overflow_data *data, |
509 | EXPORT_SYMBOL(__ubsan_handle_add_overflow); |
510 | |
511 | void __ubsan_handle_sub_overflow(struct overflow_data *data, |
512 | - unsigned long lhs, |
513 | - unsigned long rhs) |
514 | + void *lhs, void *rhs) |
515 | { |
516 | handle_overflow(data, lhs, rhs, '-'); |
517 | } |
518 | EXPORT_SYMBOL(__ubsan_handle_sub_overflow); |
519 | |
520 | void __ubsan_handle_mul_overflow(struct overflow_data *data, |
521 | - unsigned long lhs, |
522 | - unsigned long rhs) |
523 | + void *lhs, void *rhs) |
524 | { |
525 | handle_overflow(data, lhs, rhs, '*'); |
526 | } |
527 | EXPORT_SYMBOL(__ubsan_handle_mul_overflow); |
528 | |
529 | void __ubsan_handle_negate_overflow(struct overflow_data *data, |
530 | - unsigned long old_val) |
531 | + void *old_val) |
532 | { |
533 | unsigned long flags; |
534 | char old_val_str[VALUE_LENGTH]; |
535 | @@ -242,8 +241,7 @@ EXPORT_SYMBOL(__ubsan_handle_negate_overflow); |
536 | |
537 | |
538 | void __ubsan_handle_divrem_overflow(struct overflow_data *data, |
539 | - unsigned long lhs, |
540 | - unsigned long rhs) |
541 | + void *lhs, void *rhs) |
542 | { |
543 | unsigned long flags; |
544 | char rhs_val_str[VALUE_LENGTH]; |
545 | @@ -328,7 +326,7 @@ static void ubsan_type_mismatch_common(struct type_mismatch_data_common *data, |
546 | } |
547 | |
548 | void __ubsan_handle_type_mismatch(struct type_mismatch_data *data, |
549 | - unsigned long ptr) |
550 | + void *ptr) |
551 | { |
552 | struct type_mismatch_data_common common_data = { |
553 | .location = &data->location, |
554 | @@ -337,12 +335,12 @@ void __ubsan_handle_type_mismatch(struct type_mismatch_data *data, |
555 | .type_check_kind = data->type_check_kind |
556 | }; |
557 | |
558 | - ubsan_type_mismatch_common(&common_data, ptr); |
559 | + ubsan_type_mismatch_common(&common_data, (unsigned long)ptr); |
560 | } |
561 | EXPORT_SYMBOL(__ubsan_handle_type_mismatch); |
562 | |
563 | void __ubsan_handle_type_mismatch_v1(struct type_mismatch_data_v1 *data, |
564 | - unsigned long ptr) |
565 | + void *ptr) |
566 | { |
567 | |
568 | struct type_mismatch_data_common common_data = { |
569 | @@ -352,7 +350,7 @@ void __ubsan_handle_type_mismatch_v1(struct type_mismatch_data_v1 *data, |
570 | .type_check_kind = data->type_check_kind |
571 | }; |
572 | |
573 | - ubsan_type_mismatch_common(&common_data, ptr); |
574 | + ubsan_type_mismatch_common(&common_data, (unsigned long)ptr); |
575 | } |
576 | EXPORT_SYMBOL(__ubsan_handle_type_mismatch_v1); |
577 | |
578 | @@ -376,7 +374,7 @@ void __ubsan_handle_nonnull_return(struct nonnull_return_data *data) |
579 | EXPORT_SYMBOL(__ubsan_handle_nonnull_return); |
580 | |
581 | void __ubsan_handle_vla_bound_not_positive(struct vla_bound_data *data, |
582 | - unsigned long bound) |
583 | + void *bound) |
584 | { |
585 | unsigned long flags; |
586 | char bound_str[VALUE_LENGTH]; |
587 | @@ -393,8 +391,7 @@ void __ubsan_handle_vla_bound_not_positive(struct vla_bound_data *data, |
588 | } |
589 | EXPORT_SYMBOL(__ubsan_handle_vla_bound_not_positive); |
590 | |
591 | -void __ubsan_handle_out_of_bounds(struct out_of_bounds_data *data, |
592 | - unsigned long index) |
593 | +void __ubsan_handle_out_of_bounds(struct out_of_bounds_data *data, void *index) |
594 | { |
595 | unsigned long flags; |
596 | char index_str[VALUE_LENGTH]; |
597 | @@ -412,7 +409,7 @@ void __ubsan_handle_out_of_bounds(struct out_of_bounds_data *data, |
598 | EXPORT_SYMBOL(__ubsan_handle_out_of_bounds); |
599 | |
600 | void __ubsan_handle_shift_out_of_bounds(struct shift_out_of_bounds_data *data, |
601 | - unsigned long lhs, unsigned long rhs) |
602 | + void *lhs, void *rhs) |
603 | { |
604 | unsigned long flags; |
605 | struct type_descriptor *rhs_type = data->rhs_type; |
606 | @@ -463,7 +460,7 @@ void __ubsan_handle_builtin_unreachable(struct unreachable_data *data) |
607 | EXPORT_SYMBOL(__ubsan_handle_builtin_unreachable); |
608 | |
609 | void __ubsan_handle_load_invalid_value(struct invalid_value_data *data, |
610 | - unsigned long val) |
611 | + void *val) |
612 | { |
613 | unsigned long flags; |
614 | char val_str[VALUE_LENGTH]; |
615 | diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c |
616 | index cc061495f653..fe4fb0c1fa61 100644 |
617 | --- a/net/bluetooth/hci_conn.c |
618 | +++ b/net/bluetooth/hci_conn.c |
619 | @@ -1165,6 +1165,14 @@ int hci_conn_check_link_mode(struct hci_conn *conn) |
620 | !test_bit(HCI_CONN_ENCRYPT, &conn->flags)) |
621 | return 0; |
622 | |
623 | + /* The minimum encryption key size needs to be enforced by the |
624 | + * host stack before establishing any L2CAP connections. The |
625 | + * specification in theory allows a minimum of 1, but to align |
626 | + * BR/EDR and LE transports, a minimum of 7 is chosen. |
627 | + */ |
628 | + if (conn->enc_key_size < HCI_MIN_ENC_KEY_SIZE) |
629 | + return 0; |
630 | + |
631 | return 1; |
632 | } |
633 | |
634 | diff --git a/net/bluetooth/hidp/sock.c b/net/bluetooth/hidp/sock.c |
635 | index 008ba439bd62..cc80c76177b6 100644 |
636 | --- a/net/bluetooth/hidp/sock.c |
637 | +++ b/net/bluetooth/hidp/sock.c |
638 | @@ -76,6 +76,7 @@ static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long |
639 | sockfd_put(csock); |
640 | return err; |
641 | } |
642 | + ca.name[sizeof(ca.name)-1] = 0; |
643 | |
644 | err = hidp_connection_add(&ca, csock, isock); |
645 | if (!err && copy_to_user(argp, &ca, sizeof(ca))) |
646 | diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c |
647 | index 84f86745c30e..828bc615a190 100644 |
648 | --- a/sound/soc/codecs/cs4270.c |
649 | +++ b/sound/soc/codecs/cs4270.c |
650 | @@ -643,6 +643,7 @@ static const struct regmap_config cs4270_regmap = { |
651 | .reg_defaults = cs4270_reg_defaults, |
652 | .num_reg_defaults = ARRAY_SIZE(cs4270_reg_defaults), |
653 | .cache_type = REGCACHE_RBTREE, |
654 | + .write_flag_mask = CS4270_I2C_INCR, |
655 | |
656 | .readable_reg = cs4270_reg_is_readable, |
657 | .volatile_reg = cs4270_reg_is_volatile, |
658 | diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c |
659 | index e45518629968..2234d0c04165 100644 |
660 | --- a/sound/soc/codecs/nau8810.c |
661 | +++ b/sound/soc/codecs/nau8810.c |
662 | @@ -414,9 +414,9 @@ static const struct snd_soc_dapm_widget nau8810_dapm_widgets[] = { |
663 | SND_SOC_DAPM_MIXER("Mono Mixer", NAU8810_REG_POWER3, |
664 | NAU8810_MOUTMX_EN_SFT, 0, &nau8810_mono_mixer_controls[0], |
665 | ARRAY_SIZE(nau8810_mono_mixer_controls)), |
666 | - SND_SOC_DAPM_DAC("DAC", "HiFi Playback", NAU8810_REG_POWER3, |
667 | + SND_SOC_DAPM_DAC("DAC", "Playback", NAU8810_REG_POWER3, |
668 | NAU8810_DAC_EN_SFT, 0), |
669 | - SND_SOC_DAPM_ADC("ADC", "HiFi Capture", NAU8810_REG_POWER2, |
670 | + SND_SOC_DAPM_ADC("ADC", "Capture", NAU8810_REG_POWER2, |
671 | NAU8810_ADC_EN_SFT, 0), |
672 | SND_SOC_DAPM_PGA("SpkN Out", NAU8810_REG_POWER3, |
673 | NAU8810_NSPK_EN_SFT, 0, NULL, 0), |
674 | diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c |
675 | index 28fdfc5ec544..c27e3476848a 100644 |
676 | --- a/sound/soc/codecs/tlv320aic32x4.c |
677 | +++ b/sound/soc/codecs/tlv320aic32x4.c |
678 | @@ -316,6 +316,8 @@ static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = { |
679 | SND_SOC_DAPM_INPUT("IN2_R"), |
680 | SND_SOC_DAPM_INPUT("IN3_L"), |
681 | SND_SOC_DAPM_INPUT("IN3_R"), |
682 | + SND_SOC_DAPM_INPUT("CM_L"), |
683 | + SND_SOC_DAPM_INPUT("CM_R"), |
684 | }; |
685 | |
686 | static const struct snd_soc_dapm_route aic32x4_dapm_routes[] = { |
687 | diff --git a/sound/soc/intel/common/sst-firmware.c b/sound/soc/intel/common/sst-firmware.c |
688 | index 79a9fdf94d38..582b30a5118d 100644 |
689 | --- a/sound/soc/intel/common/sst-firmware.c |
690 | +++ b/sound/soc/intel/common/sst-firmware.c |
691 | @@ -1252,11 +1252,15 @@ struct sst_dsp *sst_dsp_new(struct device *dev, |
692 | goto irq_err; |
693 | |
694 | err = sst_dma_new(sst); |
695 | - if (err) |
696 | - dev_warn(dev, "sst_dma_new failed %d\n", err); |
697 | + if (err) { |
698 | + dev_err(dev, "sst_dma_new failed %d\n", err); |
699 | + goto dma_err; |
700 | + } |
701 | |
702 | return sst; |
703 | |
704 | +dma_err: |
705 | + free_irq(sst->irq, sst); |
706 | irq_err: |
707 | if (sst->ops->free) |
708 | sst->ops->free(sst); |
709 | diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c |
710 | index b111ecda6439..1dbcdc99dbe3 100644 |
711 | --- a/sound/soc/soc-pcm.c |
712 | +++ b/sound/soc/soc-pcm.c |
713 | @@ -894,10 +894,13 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, |
714 | codec_params = *params; |
715 | |
716 | /* fixup params based on TDM slot masks */ |
717 | - if (codec_dai->tx_mask) |
718 | + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && |
719 | + codec_dai->tx_mask) |
720 | soc_pcm_codec_params_fixup(&codec_params, |
721 | codec_dai->tx_mask); |
722 | - if (codec_dai->rx_mask) |
723 | + |
724 | + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE && |
725 | + codec_dai->rx_mask) |
726 | soc_pcm_codec_params_fixup(&codec_params, |
727 | codec_dai->rx_mask); |
728 |