Re: [PATCH v3 5/8] s390/pci: Add error cleanup in zpci_directed_irq_init()

From: Niklas Schnelle

Date: Mon Oct 12 2026 - 04:45:51 EST


On Fri, 2026-10-09 at 08:15 +0200, Tobias Schumacher wrote:
> If per-CPU airq_iv allocation fails in the loop, previously allocated
> vectors and arrays leak. Add proper error path to release all resources
> on failure.
>
> The error path frees zpci_sbv, but SIC_IRQ_MODE_DIRECT has already
> programmed its address into the hardware. Set the directed interrupt
> mode only after all allocations have succeeded, so a failed init leaves
> no freed memory registered with the hardware.
>
> Fixes: e979ce7bced2 ("s390/pci: provide support for CPU directed interrupts")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Tobias Schumacher <ts@xxxxxxxxxxxxx>
> ---
> arch/s390/pci/pci_irq.c | 26 +++++++++++++++++++-------
> 1 file changed, 19 insertions(+), 7 deletions(-)
>

Looks good now, thanks for putting in the work!

Reviewed-by: Niklas Schnelle <schnelle@xxxxxxxxxxxxx>