projects
/
linux
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ae7477
)
regmap: Switch to use kmemdup_array()
author
Andy Shevchenko
<andriy.shevchenko@linux.intel.com>
Thu, 6 Jun 2024 16:46:22 +0000
(19:46 +0300)
committer
Mark Brown
<broonie@kernel.org>
Fri, 7 Jun 2024 13:28:21 +0000
(14:28 +0100)
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>
drivers/base/regmap/regmap.c
patch
|
blob
|
history
diff --git
a/drivers/base/regmap/regmap.c
b/drivers/base/regmap/regmap.c
index 0a34dd3c4f38d298b8766065026cc465801f7aa7..88c02b71b2ee125c806c4f4f0df526a2baec790d 100644
(file)
--- a/
drivers/base/regmap/regmap.c
+++ b/
drivers/base/regmap/regmap.c
@@
-2347,7
+2347,7
@@
int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val,
} 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;