kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] irqchip/irq-mvebu-gicp: allocate enough memory for spi_bitmap
@ 2017-06-30  8:00 Dan Carpenter
  2017-06-30  8:10 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-06-30  8:00 UTC (permalink / raw)
  To: linux-arm-kernel

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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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;
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] irqchip/irq-mvebu-gicp: allocate enough memory for spi_bitmap
  2017-06-30  8:00 [PATCH] irqchip/irq-mvebu-gicp: allocate enough memory for spi_bitmap Dan Carpenter
@ 2017-06-30  8:10 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2017-06-30  8:10 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Fri, 30 Jun 2017 11:00:49 +0300, Dan Carpenter wrote:
> 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")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Indeed:

Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Thanks for spotting the mistake.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-30  8:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-30  8:00 [PATCH] irqchip/irq-mvebu-gicp: allocate enough memory for spi_bitmap Dan Carpenter
2017-06-30  8:10 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).