projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ee3de3c
)
OPP: switch to use kmemdup_array()
author
Zhang Enpei
<zhang.enpei@zte.com.cn>
Thu, 15 May 2025 12:13:12 +0000
(20:13 +0800)
committer
Viresh Kumar
<viresh.kumar@linaro.org>
Mon, 19 May 2025 10:07:53 +0000
(15:37 +0530)
Use kmemdup_array() to avoid multiplication and possible overflows.
Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/opp/core.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/opp/core.c
b/drivers/opp/core.c
index 72fbb6cadc23d2a60dea0c4559850c01df5cf587..edbd60501cf00dfd1957f7d19b228d1c61bbbdcc 100644
(file)
--- a/
drivers/opp/core.c
+++ b/
drivers/opp/core.c
@@
-2087,8
+2087,8
@@
static int _opp_set_supported_hw(struct opp_table *opp_table,
if (opp_table->supported_hw)
return 0;
- opp_table->supported_hw = kmemdup
(versions, count * sizeof(*versions)
,
- GFP_KERNEL);
+ opp_table->supported_hw = kmemdup
_array(versions, count
,
+
sizeof(*versions),
GFP_KERNEL);
if (!opp_table->supported_hw)
return -ENOMEM;