mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 12:03:54 +02:00
OPP: switch to use kmemdup_array()
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>
This commit is contained in:
parent
ee3de3cf70
commit
03eadcbd98
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user