1
0
Fork 0

irqchip/irq-mvebu-gicp: Allocate enough memory for spi_bitmap

BITS_TO_LONGS() gives us the number of longs we need, but we want to
allocate the number of bytes.

Fixes: a68a63cb4d ("irqchip/irq-mvebu-gicp: Add new driver for Marvell GICP")
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
hifive-unleashed-5.1
Dan Carpenter 2017-06-30 11:00:49 +03:00 committed by Marc Zyngier
parent 866d7c1b0a
commit 478a2db828
1 changed files with 2 additions and 2 deletions

View File

@ -226,8 +226,8 @@ static int mvebu_gicp_probe(struct platform_device *pdev)
}
gicp->spi_bitmap = devm_kzalloc(&pdev->dev,
BITS_TO_LONGS(gicp->spi_cnt),
GFP_KERNEL);
BITS_TO_LONGS(gicp->spi_cnt) * sizeof(long),
GFP_KERNEL);
if (!gicp->spi_bitmap)
return -ENOMEM;