Message ID | 20250515201312562vXizlDSg23_PhQ1nALjYV@zte.com.cn |
---|---|
State | New |
Headers | show |
Series | OPP: switch to use kmemdup_array() | expand |
diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 72fbb6cadc23..d85e3371493f 100644 --- 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;