genirq/irq_sim: Initialize work context pointers properly
PATCH 1/1 genirq/irq_sim: Initialize work context pointers properly
From: Gyeyoung Baek <[email protected]>
[ Upstream commit 8a2277a3c9e4cc5398f80821afe7ecbe9bdf2819 ]
Initialize ops member's pointers properly by using kzalloc() instead of kmalloc() when allocating the simulation work context. Otherwise the pointers contain random content leading to invalid dereferencing.
Signed-off-by Gyeyoung Baek <[email protected]>
Signed-off-by Thomas Gleixner <[email protected]>
[ The context change is due to the commit 011f583781fa ("genirq/irq_sim: add an extended irq_sim initializer") which is irrelevant to the logic of this patch. ]
Signed-off-by Rahul Sharma <[email protected]>
--- kernel/irq/irq_sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/irq_sim.c +1 -1
@@ -166,7 +166,7 @@ struct irq_domain *irq_domain_create_sim(struct fwnode_handle *fwnode, {struct irq_sim_work_ctx *work_ctx; - work_ctx =kmalloc (sizeof (*work_ctx),GFP_KERNEL ); + work_ctx =kzalloc (sizeof (*work_ctx),GFP_KERNEL );if (!work_ctx) goto err_out;
Signature · 1 line
2.34.1