Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pwm: pwm-mediatek: Allocate clk_pwms with devm_kmalloc_array

Switch from devm_kcalloc to devm_kmalloc_array when allocating clk_pwms,
as this structure is being filled right after allocating it, hence
there is no need to zero it out beforehand.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>

authored by

AngeloGioacchino Del Regno and committed by
Thierry Reding
446925f1 5264e8ca

+1 -1
+1 -1
drivers/pwm/pwm-mediatek.c
··· 221 221 if (IS_ERR(pc->regs)) 222 222 return PTR_ERR(pc->regs); 223 223 224 - pc->clk_pwms = devm_kcalloc(&pdev->dev, pc->soc->num_pwms, 224 + pc->clk_pwms = devm_kmalloc_array(&pdev->dev, pc->soc->num_pwms, 225 225 sizeof(*pc->clk_pwms), GFP_KERNEL); 226 226 if (!pc->clk_pwms) 227 227 return -ENOMEM;