mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 09:13:38 +00:00
clk: visconti: Switch to use kmemdup_array()
Let the kmemdup_array() take care about multiplication and possible overflows. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240814125513.2637955-3-andriy.shevchenko@linux.intel.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
parent
0da7faca53
commit
1b2ed9df08
@ -262,8 +262,8 @@ static struct clk_hw *visconti_register_pll(struct visconti_pll_provider *ctx,
|
||||
for (len = 0; rate_table[len].rate != 0; )
|
||||
len++;
|
||||
pll->rate_count = len;
|
||||
pll->rate_table = kmemdup(rate_table,
|
||||
pll->rate_count * sizeof(struct visconti_pll_rate_table),
|
||||
pll->rate_table = kmemdup_array(rate_table,
|
||||
pll->rate_count, sizeof(*pll->rate_table),
|
||||
GFP_KERNEL);
|
||||
WARN(!pll->rate_table, "%s: could not allocate rate table for %s\n", __func__, name);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user