Commit fcd5b740 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Kevin Hilman

ARM: omap2: Switch to use kmemdup_array()

Let the kmemdup_array() take care about multiplication and possible
overflows.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Link: https://lore.kernel.org/r/20240606165104.3031737-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarKevin Hilman <khilman@baylibre.com>
parent 67cbfa95
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment