diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-06-30 10:00:49 +0200 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2017-06-30 16:32:46 +0200 |
commit | 478a2db82863db9f1c135111e78298e6ed5022f3 (patch) | |
tree | 30cd3bf6ccc129ecf27d50379a2ff476a27a3259 /drivers/irqchip | |
parent | irqchip/gic-v3: Fix out-of-bound access in gic_set_affinity (diff) | |
download | linux-478a2db82863db9f1c135111e78298e6ed5022f3.tar.xz linux-478a2db82863db9f1c135111e78298e6ed5022f3.zip |
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: a68a63cb4dfc ("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>
Diffstat (limited to '')
-rw-r--r-- | drivers/irqchip/irq-mvebu-gicp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/irqchip/irq-mvebu-gicp.c b/drivers/irqchip/irq-mvebu-gicp.c index 45358ac9bb1d..b283fc90be1e 100644 --- a/drivers/irqchip/irq-mvebu-gicp.c +++ b/drivers/irqchip/irq-mvebu-gicp.c @@ -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; |