Skip to content

Commit fcd5b74

Browse files
andy-shevkhilman
authored andcommitted
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>
1 parent 67cbfa9 commit fcd5b74

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/arm/mach-omap2/omap_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ static struct omap_device *omap_device_alloc(struct platform_device *pdev,
315315

316316
od->hwmods_cnt = oh_cnt;
317317

318-
hwmods = kmemdup(ohs, sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL);
318+
hwmods = kmemdup_array(ohs, oh_cnt, sizeof(*hwmods), GFP_KERNEL);
319319
if (!hwmods)
320320
goto oda_exit2;
321321

0 commit comments

Comments
 (0)