mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 17:23:36 +00:00
ARM: omap2: 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> Reviewed-by: Aaro Koskinen <aaro.koskinen@iki.fi> Link: https://lore.kernel.org/r/20240606165104.3031737-1-andriy.shevchenko@linux.intel.com Signed-off-by: Kevin Hilman <khilman@baylibre.com>
This commit is contained in:
parent
67cbfa95ad
commit
fcd5b7401d
@ -315,7 +315,7 @@ static struct omap_device *omap_device_alloc(struct platform_device *pdev,
|
||||
|
||||
od->hwmods_cnt = oh_cnt;
|
||||
|
||||
hwmods = kmemdup(ohs, sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL);
|
||||
hwmods = kmemdup_array(ohs, oh_cnt, sizeof(*hwmods), GFP_KERNEL);
|
||||
if (!hwmods)
|
||||
goto oda_exit2;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user