mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] genirq/msi: Fix MSI domain debugfs show
@ 2025-04-30 12:48 Andrew Jones
  2025-04-30 21:32 ` [tip: irq/urgent] genirq/msi: Prevent NULL pointer dereference in msi_domain_debug_show() tip-bot2 for Andrew Jones
  2025-05-01  1:51 ` [PATCH] genirq/msi: Fix MSI domain debugfs show Hans Zhang
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Jones @ 2025-04-30 12:48 UTC (permalink / raw)
  To: linux-kernel; +Cc: tglx, 18255117159

irq_domain_debug_show_one() calls the irqdomain's debug_show() with
a non-null domain pointer and a null irqdata pointer
(irq_debug_show_data() calls debug_show() with those the other way
around). Ensure we have a non-null irqdata pointer in
msi_domain_debug_show() before dereferencing it.

Fixes: 01499ae673dc ("genirq/msi: Expose MSI message data in debugfs")
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
---
 kernel/irq/msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index 5c8d43cdb0a3..c05ba7ca00fa 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -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;
-- 
2.49.0


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

end of thread, other threads:[~2025-05-02  8:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-30 12:48 [PATCH] genirq/msi: Fix MSI domain debugfs show Andrew Jones
2025-04-30 21:32 ` [tip: irq/urgent] genirq/msi: Prevent NULL pointer dereference in msi_domain_debug_show() tip-bot2 for Andrew Jones
2025-05-01  1:51 ` [PATCH] genirq/msi: Fix MSI domain debugfs show Hans Zhang
2025-05-02  7:33   ` Andrew Jones
2025-05-02  8:40     ` Hans Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome