This is version 2 of the cleanup work. The previous version can be found here: https://lore.kernel.org/all/20250309083453.900516105@xxxxxxxxxxxxx While converting the MSI descriptor locking to a lock guard() I stumbled over various abuse of MSI descriptors (again). The following series cleans up the offending code and converts the MSI descriptor locking over to lock guards. Changes vs. V1: - Introduce retain_ptr() to allow using __free() when the allocation is consumed by a called function (on success) and therefore no_free_ptr() can't be used. - Rework the PCI/MSI changes to avoid gotos in guard sections - Drop patch 1 as it's already applied - Collect Reviewed/Tested/Acked-by tags where appropriate Patches 3,4,6-10 are unmodifed. The series applies on: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/msi and is available from git: git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git irq/msi Thanks, tglx --- drivers/ntb/msi.c | 22 +--- drivers/pci/controller/pci-hyperv.c | 14 --- drivers/pci/msi/api.c | 6 - drivers/pci/msi/msi.c | 168 ++++++++++++++++++++++-------------- drivers/pci/pci.h | 9 + drivers/pci/tph.c | 44 --------- drivers/soc/ti/ti_sci_inta_msi.c | 10 -- drivers/ufs/host/ufs-qcom.c | 75 ++++++++-------- include/linux/cleanup.h | 17 +++ include/linux/irqdomain.h | 2 include/linux/msi.h | 7 + kernel/irq/msi.c | 125 ++++++++++---------------- 12 files changed, 247 insertions(+), 252 deletions(-)