Commit c1f664d2 authored by Huacai Chen's avatar Huacai Chen Committed by Marc Zyngier

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: 632dcc2c ("irqchip: Add Loongson PCH MSI controller")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210209071051.2078435-1-chenhuacai@loongson.cn
parent be1abc5b
...@@ -225,7 +225,7 @@ static int pch_msi_init(struct device_node *node, ...@@ -225,7 +225,7 @@ static int pch_msi_init(struct device_node *node,
goto err_priv; goto err_priv;
} }
priv->msi_map = bitmap_alloc(priv->num_irqs, GFP_KERNEL); priv->msi_map = bitmap_zalloc(priv->num_irqs, GFP_KERNEL);
if (!priv->msi_map) { if (!priv->msi_map) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_priv; goto err_priv;
......
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