提交 478a2db8 编写于 作者: D Dan Carpenter 提交者: Marc Zyngier

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: a68a63cb ("irqchip/irq-mvebu-gicp: Add new driver for Marvell GICP")
Acked-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
上级 866d7c1b
...@@ -226,8 +226,8 @@ static int mvebu_gicp_probe(struct platform_device *pdev) ...@@ -226,8 +226,8 @@ static int mvebu_gicp_probe(struct platform_device *pdev)
} }
gicp->spi_bitmap = devm_kzalloc(&pdev->dev, gicp->spi_bitmap = devm_kzalloc(&pdev->dev,
BITS_TO_LONGS(gicp->spi_cnt), BITS_TO_LONGS(gicp->spi_cnt) * sizeof(long),
GFP_KERNEL); GFP_KERNEL);
if (!gicp->spi_bitmap) if (!gicp->spi_bitmap)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册