diff options
author | Huacai Chen <chenhuacai@loongson.cn> | 2021-02-09 10:10:51 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-04 13:38:42 +0300 |
commit | c41de6eae2483eb17ff9a2c5327999069e81dc21 (patch) | |
tree | 09ddd319544fca03429c51e1f04ca98e4feabd28 | |
parent | 833f5208b142f52584e7eaec3081533edcbc3ddf (diff) | |
download | linux-c41de6eae2483eb17ff9a2c5327999069e81dc21.tar.xz |
irqchip/loongson-pch-msi: Use bitmap_zalloc() to allocate bitmap
commit c1f664d2400e73d5ca0fcd067fa5847d2c789c11 upstream.
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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/irqchip/irq-loongson-pch-msi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/irqchip/irq-loongson-pch-msi.c b/drivers/irqchip/irq-loongson-pch-msi.c index 12aeeab43289..32562b7e681b 100644 --- a/drivers/irqchip/irq-loongson-pch-msi.c +++ b/drivers/irqchip/irq-loongson-pch-msi.c @@ -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; |