Skip to content

Commit

Permalink
irqchip/loongson-pch-msi: Use bitmap_zalloc() to allocate bitmap
Browse files Browse the repository at this point in the history
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: 632dcc2 ("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
  • Loading branch information
Huacai Chen authored and Marc Zyngier committed Feb 9, 2021
1 parent be1abc5 commit c1f664d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-loongson-pch-msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ static int pch_msi_init(struct device_node *node,
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) {
ret = -ENOMEM;
goto err_priv;
Expand Down

0 comments on commit c1f664d

Please sign in to comment.