Commit 35a5ab8
soundwire: use krealloc_array to prevent integer overflow
Replace the use of krealloc() with krealloc_array() in
sdw_add_element_group_count to mitigate the risk of integer overflow during
memory allocation size calculation.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Baoli.Zhang <baoli.zhang@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260506055039.3751028-4-baoli.zhang@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>1 parent 654a7ae commit 35a5ab8
1 file changed
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
312 | | - | |
313 | | - | |
| 311 | + | |
| 312 | + | |
314 | 313 | | |
315 | 314 | | |
316 | 315 | | |
317 | 316 | | |
318 | 317 | | |
319 | | - | |
320 | | - | |
321 | | - | |
| 318 | + | |
| 319 | + | |
322 | 320 | | |
323 | 321 | | |
324 | 322 | | |
| |||
0 commit comments