]> git.baikalelectronics.ru Git - kernel.git/commitdiff
irqchip/irq-mvebu-gicp: Allocate enough memory for spi_bitmap
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 30 Jun 2017 08:00:49 +0000 (11:00 +0300)
committerMarc Zyngier <marc.zyngier@arm.com>
Fri, 30 Jun 2017 14:32:46 +0000 (15:32 +0100)
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>
drivers/irqchip/irq-mvebu-gicp.c

index 45358ac9bb1dd5da3bd8319907eb0dcb767a5713..b283fc90be1e2505066867d269bdecfe7a1113e4 100644 (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;