Re: [PATCH] PCI: vmd: Fix wrong kfree() in vmd_msi_free()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 07 2025 at 08:38, Nam Cao wrote:

> vmd_msi_alloc() allocates struct vmd_irq and stashes it into
> irq_domain->irq-data->chip_data. vmd_msi_free() extracts the pointer by
> calling irq_get_chip_data() and frees it.
>
> irq_get_chip_data() returns the chip_data of the top interrupt domain. This
> worked in the past, because VMD's interrupt domain was the top domain.
>
> But since commit d7d8ab87e3e7 ("PCI: vmd: Switch to
> msi_create_parent_irq_domain()") changed the interrupt domain hierarchy,
> VMD's interrupt domain is not the top domain anymore. irq_get_chip_data()
> now returns the chip_data of the MSI devices' interrupt domain. It is
> therefore broken for vmd_msi_free() to kfree() this irq_data.
>
> Fix this issue, correctly extract the chip_data of VMD's interrupt domain.
>
> Fixes: d7d8ab87e3e7 ("PCI: vmd: Switch to msi_create_parent_irq_domain()")
> Reported-by: Kenneth Crudup <kenny@xxxxxxxxx>
> Closes: https://lore.kernel.org/linux-pci/dfa40e48-8840-4e61-9fda-25cdb3ad81c1@xxxxxxxxx/
> Reported-by: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>
> Closes: https://lore.kernel.org/linux-pci/ed53280ed15d1140700b96cca2734bf327ee92539e5eb68e80f5bbbf0f01@xxxxxxxxxxxxxxxxx/
> Tested-by: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>
> Tested-by: Kenneth Crudup <kenny@xxxxxxxxx>
> Signed-off-by: Nam Cao <namcao@xxxxxxxxxxxxx>

Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux