Commit 738c985d authored by Markus Elfring's avatar Markus Elfring Committed by Tony Lindgren

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 16e7ea53
......@@ -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;
......
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