mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 13:22:23 +00:00
regmap: Switch to use kmemdup_array()
Let the kememdup_array() take care about multiplication and possible overflows. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240606164717.3031107-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
0ae7477599
commit
f6841d41a8
@ -2347,7 +2347,7 @@ out:
|
||||
} else {
|
||||
void *wval;
|
||||
|
||||
wval = kmemdup(val, val_count * val_bytes, map->alloc_flags);
|
||||
wval = kmemdup_array(val, val_count, val_bytes, map->alloc_flags);
|
||||
if (!wval)
|
||||
return -ENOMEM;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user