diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2024-06-06 18:51:04 +0200 |
---|---|---|
committer | Kevin Hilman <khilman@baylibre.com> | 2024-07-31 00:19:44 +0200 |
commit | fcd5b7401dc4b25880e46769975c85091a3c2946 (patch) | |
tree | 4e9d7717a6fc102c34923d484644a7a43759b8f1 /arch/arm | |
parent | ARM: omap1: Remove unused struct 'dma_link_info' (diff) | |
download | linux-fcd5b7401dc4b25880e46769975c85091a3c2946.tar.xz linux-fcd5b7401dc4b25880e46769975c85091a3c2946.zip |
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>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/omap_device.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c index fca7869c8075..800980057373 100644 --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -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; |