Skip to content

Commit

Permalink
ionic: Initialize the 'lif->dbid_inuse' bitmap
Browse files Browse the repository at this point in the history
[ Upstream commit 140c7bc ]

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: 6461b44 ("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>
  • Loading branch information
tititiou36 authored and gregkh committed Jan 5, 2022
1 parent a3dffd1 commit 30a26a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/pensando/ionic/ionic_lif.c
Expand Up @@ -3283,7 +3283,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;
Expand Down

0 comments on commit 30a26a8

Please sign in to comment.