aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <[email protected]>2024-06-06 19:46:22 +0300
committerMark Brown <[email protected]>2024-06-07 14:28:21 +0100
commitf6841d41a8a36a4c5cbfee39280845f83fed6a87 (patch)
treed1c666cff89cc0f78b6224731d036b2b4fd5669f
parent0ae747759930186fbc3ab470ac4e40899c52438c (diff)
regmap: Switch to use kmemdup_array()
Let the kememdup_array() take care about multiplication and possible overflows. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--drivers/base/regmap/regmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 0a34dd3c4f38..88c02b71b2ee 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -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;