Skip to content

Commit

Permalink
irqchip/irq-mvebu-gicp: Allocate enough memory for spi_bitmap
Browse files Browse the repository at this point in the history
BITS_TO_LONGS() gives us the number of longs we need, but we want to
allocate the number of bytes.

Fixes: a68a63c ("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>
  • Loading branch information
Dan Carpenter authored and Marc Zyngier committed Jun 30, 2017
1 parent 866d7c1 commit 478a2db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/irqchip/irq-mvebu-gicp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 478a2db

Please sign in to comment.