mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04: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:
committed by
Mark Brown
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user