Skip to content

Commit

Permalink
genirq/msi: Prevent NULL pointer dereference in msi_domain_debug_show()
Browse files Browse the repository at this point in the history
irq_domain_debug_show_one() calls msi_domain_debug_show() with a non-NULL
domain pointer and a NULL irq_data pointer. irq_debug_show_data() calls it
with a NULL domain pointer.

The domain pointer is not used, but the irq_data pointer is required to be
non-NULL and lacks a NULL pointer check.

Add the missing NULL pointer check to ensure there is a non-NULL irq_data
pointer in msi_domain_debug_show() before dereferencing it.

[ tglx: Massaged change log ]

Fixes: 01499ae ("genirq/msi: Expose MSI message data in debugfs")
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250430124836.49964-2-ajones@ventanamicro.com
  • Loading branch information
Andrew Jones authored and Thomas Gleixner committed Apr 30, 2025
1 parent b443265 commit e6a3fc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/irq/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ static int msi_domain_translate(struct irq_domain *domain, struct irq_fwspec *fw
static void msi_domain_debug_show(struct seq_file *m, struct irq_domain *d,
struct irq_data *irqd, int ind)
{
struct msi_desc *desc = irq_data_get_msi_desc(irqd);
struct msi_desc *desc = irqd ? irq_data_get_msi_desc(irqd) : NULL;

if (!desc)
return;
Expand Down

0 comments on commit e6a3fc4

Please sign in to comment.