summaryrefslogtreecommitdiff
path: root/drivers/dma/ste_dma40.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2016-09-17 12:44:55 +0300
committerVinod Koul <vinod.koul@intel.com>2016-09-26 20:36:17 +0300
commit28c01058b28527be2a81e8ba2a53437910defbf3 (patch)
tree4037c89e5f3cdc30e54d63cca4d4528c3d4a6b5f /drivers/dma/ste_dma40.c
parente349d4b7317818cbb21096ead26420c80819ddd4 (diff)
downloadlinux-28c01058b28527be2a81e8ba2a53437910defbf3.tar.xz
ste_dma40: Use kmalloc_array() in d40_hw_detect_init()
A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kmalloc_array". This issue was detected also by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/ste_dma40.c')
-rw-r--r--drivers/dma/ste_dma40.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index a426abd55dee..4892c23b6c7b 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3301,9 +3301,9 @@ static struct d40_base * __init d40_hw_detect_init(struct platform_device *pdev)
if (!base->lookup_log_chans)
goto failure;
- base->reg_val_backup_chan = kmalloc(base->num_phy_chans *
- sizeof(d40_backup_regs_chan),
- GFP_KERNEL);
+ base->reg_val_backup_chan = kmalloc_array(base->num_phy_chans,
+ sizeof(d40_backup_regs_chan),
+ GFP_KERNEL);
if (!base->reg_val_backup_chan)
goto failure;