Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.com
Reviewed-by: Vishakha Channapattan <vishakhavc@google.com>
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Igor Pylypiv and committed by
Martin K. Petersen
85361558 606c54ae

+2 -2
+2 -2
drivers/scsi/pm8001/pm8001_init.c
··· 179 179 } 180 180 PM8001_CHIP_DISP->chip_iounmap(pm8001_ha); 181 181 flush_workqueue(pm8001_wq); 182 - kfree(pm8001_ha->tags); 182 + bitmap_free(pm8001_ha->tags); 183 183 kfree(pm8001_ha); 184 184 } 185 185 ··· 1194 1194 can_queue = ccb_count - PM8001_RESERVE_SLOT; 1195 1195 shost->can_queue = can_queue; 1196 1196 1197 - pm8001_ha->tags = kzalloc(ccb_count, GFP_KERNEL); 1197 + pm8001_ha->tags = bitmap_zalloc(ccb_count, GFP_KERNEL); 1198 1198 if (!pm8001_ha->tags) 1199 1199 goto err_out; 1200 1200