diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-04-03 03:21:34 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-04-28 15:43:24 -0400 |
commit | 3894e9e82dfdc87fa35dc7976e0472d220228826 (patch) | |
tree | ff20bd710bb1b3f22929f19c7d53ba4f8388e50c | |
parent | 8cc3cfc5ccf1680b7c88f874912b6bec2797b76b (diff) |
irqchip: irq-crossbar: Not allocating enough memory
We are allocating the size of a pointer and not the size of the data.
This will lead to memory corruption.
There isn't actually a "cb_device" struct, btw. The code is only able
to compile because GCC knows that all pointers are the same size.
Fixes: 96ca848ef7ea ('DRIVERS: IRQCHIP: CROSSBAR: Add support for Crossbar IP')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Sricharan R <r.sricharan@ti.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>
Link: http://lkml.kernel.org/r/20140403072134.GA14286@mwanda
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | drivers/irqchip/irq-crossbar.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/irqchip/irq-crossbar.c b/drivers/irqchip/irq-crossbar.c index fc817d28d1fe..3d15d16a7088 100644 --- a/drivers/irqchip/irq-crossbar.c +++ b/drivers/irqchip/irq-crossbar.c | |||
@@ -107,7 +107,7 @@ static int __init crossbar_of_init(struct device_node *node) | |||
107 | int i, size, max, reserved = 0, entry; | 107 | int i, size, max, reserved = 0, entry; |
108 | const __be32 *irqsr; | 108 | const __be32 *irqsr; |
109 | 109 | ||
110 | cb = kzalloc(sizeof(struct cb_device *), GFP_KERNEL); | 110 | cb = kzalloc(sizeof(*cb), GFP_KERNEL); |
111 | 111 | ||
112 | if (!cb) | 112 | if (!cb) |
113 | return -ENOMEM; | 113 | return -ENOMEM; |