Skip to content

Commit ef3e73a

Browse files
covanammaddy-kerneldev
authored andcommitted
powerpc/pseries/msi: Fix NULL pointer dereference at irq domain teardown
pseries_msi_ops_teardown() reads pci_dev* from msi_alloc_info_t. However, pseries_msi_ops_prepare() does not populate this structure, thus it is all zeros. Consequently, pseries_msi_ops_teardown() triggers a NULL pointer dereference crash. struct pci_dev is available in struct irq_domain. Read it there instead. Reported-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com> Closes: https://lore.kernel.org/linuxppc-dev/878d7651-433a-46fe-a28b-1b7e893fcbe0@linux.ibm.com/ Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com> Signed-off-by: Nam Cao <namcao@linutronix.de> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20251010120307.3281720-1-namcao@linutronix.de
1 parent 3a86608 commit ef3e73a

File tree

1 file changed

+1
-2
lines changed
  • arch/powerpc/platforms/pseries

1 file changed

+1
-2
lines changed

arch/powerpc/platforms/pseries/msi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,7 @@ static int pseries_msi_ops_prepare(struct irq_domain *domain, struct device *dev
443443
*/
444444
static void pseries_msi_ops_teardown(struct irq_domain *domain, msi_alloc_info_t *arg)
445445
{
446-
struct msi_desc *desc = arg->desc;
447-
struct pci_dev *pdev = msi_desc_to_pci_dev(desc);
446+
struct pci_dev *pdev = to_pci_dev(domain->dev);
448447

449448
rtas_disable_msi(pdev);
450449
}

0 commit comments

Comments
 (0)