Commit 85361558 authored by Igor Pylypiv's avatar Igor Pylypiv Committed by Martin K. Petersen

scsi: pm80xx: Use bitmap_zalloc() for tags bitmap allocation

We used to allocate X bytes while we only need X bits.

Link: https://lore.kernel.org/r/20211101232825.2350233-5-ipylypiv@google.comReviewed-by: default avatarVishakha Channapattan <vishakhavc@google.com>
Acked-by: default avatarJack Wang <jinpu.wang@ionos.com>
Signed-off-by: default avatarIgor Pylypiv <ipylypiv@google.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 606c54ae
...@@ -179,7 +179,7 @@ static void pm8001_free(struct pm8001_hba_info *pm8001_ha) ...@@ -179,7 +179,7 @@ static void pm8001_free(struct pm8001_hba_info *pm8001_ha)
} }
PM8001_CHIP_DISP->chip_iounmap(pm8001_ha); PM8001_CHIP_DISP->chip_iounmap(pm8001_ha);
flush_workqueue(pm8001_wq); flush_workqueue(pm8001_wq);
kfree(pm8001_ha->tags); bitmap_free(pm8001_ha->tags);
kfree(pm8001_ha); kfree(pm8001_ha);
} }
...@@ -1194,7 +1194,7 @@ pm8001_init_ccb_tag(struct pm8001_hba_info *pm8001_ha, struct Scsi_Host *shost, ...@@ -1194,7 +1194,7 @@ pm8001_init_ccb_tag(struct pm8001_hba_info *pm8001_ha, struct Scsi_Host *shost,
can_queue = ccb_count - PM8001_RESERVE_SLOT; can_queue = ccb_count - PM8001_RESERVE_SLOT;
shost->can_queue = can_queue; shost->can_queue = can_queue;
pm8001_ha->tags = kzalloc(ccb_count, GFP_KERNEL); pm8001_ha->tags = bitmap_zalloc(ccb_count, GFP_KERNEL);
if (!pm8001_ha->tags) if (!pm8001_ha->tags)
goto err_out; goto err_out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment