]> git.baikalelectronics.ru Git - kernel.git/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)
committerJakub Kicinski <kuba@kernel.org>
Wed, 29 Dec 2021 00:07:35 +0000 (16:07 -0800)
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: a5af78677f90 ("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>
drivers/net/ethernet/pensando/ionic/ionic_lif.c

index 63f8a8163b5f108c2ab8913266e6c3a31dcd6f6b..2ff7be17e5afd856f1422aedcaa36a4a466ddd5e 100644 (file)
@@ -3135,7 +3135,7 @@ 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;