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

irqchip/loongson-pch-msi: Use bitmap_zalloc() to allocate bitmap

Currently we use bitmap_alloc() to allocate msi bitmap which should be
initialized with zero. This is obviously wrong but it works because msi
can fallback to legacy interrupt mode. So use bitmap_zalloc() instead.

Fixes: 632dcc2c75ef6de3272aa ("irqchip: Add Loongson PCH MSI controller")
Cc: stable@vger.kernel.org
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210209071051.2078435-1-chenhuacai@loongson.cn

authored by

Huacai Chen and committed by
Marc Zyngier
c1f664d2 be1abc5b

+1 -1
+1 -1
drivers/irqchip/irq-loongson-pch-msi.c
··· 225 225 goto err_priv; 226 226 } 227 227 228 - priv->msi_map = bitmap_alloc(priv->num_irqs, GFP_KERNEL); 228 + priv->msi_map = bitmap_zalloc(priv->num_irqs, GFP_KERNEL); 229 229 if (!priv->msi_map) { 230 230 ret = -ENOMEM; 231 231 goto err_priv;