]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
genirq/irq_sim: Initialize work context pointers properly
authorGyeyoung Baek <gye976@gmail.com>
Thu, 12 Jun 2025 12:48:27 +0000 (21:48 +0900)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 13 Jun 2025 13:36:35 +0000 (15:36 +0200)
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 <gye976@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250612124827.63259-1-gye976@gmail.com
kernel/irq/irq_sim.c

index 1a3d483548e2f303c0d15fa8e9b9214c656d2a49..ae4c9cbd1b4b9ec35dabf1c22132b9cd9ed26580 100644 (file)
@@ -202,7 +202,7 @@ struct irq_domain *irq_domain_create_sim_full(struct fwnode_handle *fwnode,
                                              void *data)
 {
        struct irq_sim_work_ctx *work_ctx __free(kfree) =
-                               kmalloc(sizeof(*work_ctx), GFP_KERNEL);
+                               kzalloc(sizeof(*work_ctx), GFP_KERNEL);
 
        if (!work_ctx)
                return ERR_PTR(-ENOMEM);