diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-10-03 21:07:33 +0200 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2017-10-11 20:13:15 +0200 |
commit | 738c985d85afdc592c0dda205b2d71043bdc5bfb (patch) | |
tree | d46a9e812190f850e7569056a99b19f7a16b4725 /arch/arm/plat-omap | |
parent | ARM: OMAP: Improve a size determination in two functions (diff) | |
download | linux-738c985d85afdc592c0dda205b2d71043bdc5bfb.tar.xz linux-738c985d85afdc592c0dda205b2d71043bdc5bfb.zip |
ARM: OMAP: Use kcalloc() in omap_system_dma_probe()
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kcalloc".
This issue was detected by using the Coccinelle software.
* Replace the specification of a data type by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/dma.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 409e4ecaebe9..d4012d6c0dcb 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -1321,8 +1321,9 @@ static int omap_system_dma_probe(struct platform_device *pdev) return -ENOMEM; if (dma_omap2plus()) { - dma_linked_lch = kzalloc(sizeof(struct dma_link_info) * - dma_lch_count, GFP_KERNEL); + dma_linked_lch = kcalloc(dma_lch_count, + sizeof(*dma_linked_lch), + GFP_KERNEL); if (!dma_linked_lch) { ret = -ENOMEM; goto exit_dma_lch_fail; |