From: Dan Carpenter Date: Fri, 30 Jun 2017 08:00:49 +0000 (+0300) Subject: irqchip/irq-mvebu-gicp: Allocate enough memory for spi_bitmap X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=478a2db82863db9f1c135111e78298e6ed5022f3;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Dan Carpenter Signed-off-by: Marc Zyngier --- 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;