forked from mirrors/linux
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
1 changed files with 2 additions and 2 deletions
|
|
@ -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 a new issue