]> git.itanic.dy.fi Git - linux-stable/commitdiff
ionic: Initialize the 'lif->dbid_inuse' bitmap
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 26 Dec 2021 14:06:17 +0000 (15:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Jan 2022 11:37:45 +0000 (12:37 +0100)
[ Upstream commit 140c7bc7d1195750342ea0e6ab76179499ae7cd7 ]

When allocated, this bitmap is not initialized. Only the first bit is set a
few lines below.

Use bitmap_zalloc() to make sure that it is cleared before being used.

Fixes: 6461b446f2a0 ("ionic: Add interrupts and doorbells")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Link: https://lore.kernel.org/r/6a478eae0b5e6c63774e1f0ddb1a3f8c38fa8ade.1640527506.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/pensando/ionic/ionic_lif.c

index 99ba3551458fc6ca6d75fbaa8f4e4a6e2df0f5d3..f9c303d76658a0cf05a05815201d318f6a6336e3 100644 (file)
@@ -1995,7 +1995,7 @@ static int ionic_lif_init(struct ionic_lif *lif)
                return -EINVAL;
        }
 
-       lif->dbid_inuse = bitmap_alloc(lif->dbid_count, GFP_KERNEL);
+       lif->dbid_inuse = bitmap_zalloc(lif->dbid_count, GFP_KERNEL);
        if (!lif->dbid_inuse) {
                dev_err(dev, "Failed alloc doorbell id bitmap, aborting\n");
                return -ENOMEM;