All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tobias Schumacher" <ts@linux.ibm.com>
To: "Niklas Schnelle" <schnelle@linux.ibm.com>,
	"Tobias Schumacher" <ts@linux.ibm.com>,
	"Gerd Bayer" <gbayer@linux.ibm.com>,
	"Julian Ruess" <julianr@linux.ibm.com>,
	"Farhan Ali" <alifm@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Halil Pasic" <pasic@linux.ibm.com>,
	"Matthew Rosato" <mjrosato@linux.ibm.com>
Cc: "Heiko Carstens" <hca@linux.ibm.com>,
	"Vasily Gorbik" <gor@linux.ibm.com>,
	"Alexander Gordeev" <agordeev@linux.ibm.com>,
	"Sven Schnelle" <svens@linux.ibm.com>,
	<linux-s390@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 5/7] s390/pci: Add error cleanup in zpci_directed_irq_init
Date: Wed, 07 Oct 2026 08:04:30 +0200	[thread overview]
Message-ID: <DLYDNZO7F3C0.2X767HD7G8PDZ@linux.ibm.com> (raw)
In-Reply-To: <2321a5e161cc30281464302cc12810ae62c286ae.camel@linux.ibm.com>

On Tue Oct 6, 2026 at 3:32 PM CEST, Niklas Schnelle wrote:
> On Mon, 2026-10-05 at 14:03 +0200, Tobias Schumacher wrote:
-- snip --

>> +
>> +out_free_dibv:
>> +	for_each_possible_cpu(cpu) {
>> +		if (zpci_dibv[cpu])
>> +			airq_iv_release(zpci_dibv[cpu]);
>> +	}
>> +	kfree(zpci_dibv);
>> +	zpci_dibv = NULL;
>> +out_free_sbv:
>> +	airq_iv_release(zpci_sbv);
>> +	zpci_sbv = NULL;
>> +	return -ENOMEM;
>
> As Sashiko notes this doesn't undo the
> zpci_set_irq_ctrl(SIC_IRQ_MODE_DIRECT, 0, &iib) and via the iib leaves
> the zpci_sbv->vector that gets freed here set in hardware. While
> Sashiko also notes this is an __init function and these allocations are
> extremely unlikely to fail I think the rollback is still just nice
> form. I think we could simply move the zpci_set_irq_ctrl() to after the
> allocations but before the cpu_enable_directed_irq(). It also seems
> more logical to set the interrupt mode only after memory has been set
> up.

Agreed, will change the order for v3.

Thanks,
Tobias

  reply	other threads:[~2026-10-07  6:04 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05 12:03 [PATCH v2 0/7] s390/pci: Fix bugs in IRQ domain migration and resource cleanup Tobias Schumacher
2026-10-05 12:03 ` [PATCH v2 1/7] s390/pci: Fix double-free and NULL deref in zpci MSI domain cleanup Tobias Schumacher
2026-10-05 12:12   ` sashiko-bot
2026-10-06  9:42   ` Niklas Schnelle
2026-10-05 12:03 ` [PATCH v2 2/7] s390/pci: Fix resource leak in zpci MSI setup Tobias Schumacher
2026-10-05 12:17   ` sashiko-bot
2026-10-06  9:55   ` Niklas Schnelle
2026-10-05 12:03 ` [PATCH v2 3/7] s390/pci: Fix MSI directed-mode teardown IRQ bit count Tobias Schumacher
2026-10-05 12:15   ` sashiko-bot
2026-10-06 11:10   ` Niklas Schnelle
2026-10-05 12:03 ` [PATCH v2 4/7] s390/pci: Fix use-after-free race in zpci floating interrupt cleanup Tobias Schumacher
2026-10-05 12:14   ` sashiko-bot
2026-10-06 15:18   ` Niklas Schnelle
2026-10-07  5:50     ` Tobias Schumacher
2026-10-06 19:23   ` Niklas Schnelle
2026-10-07  6:02     ` Tobias Schumacher
2026-10-05 12:03 ` [PATCH v2 5/7] s390/pci: Add error cleanup in zpci_directed_irq_init Tobias Schumacher
2026-10-05 12:16   ` sashiko-bot
2026-10-06 13:32   ` Niklas Schnelle
2026-10-07  6:04     ` Tobias Schumacher [this message]
2026-10-06 19:19   ` Niklas Schnelle
2026-10-07  6:10     ` Tobias Schumacher
2026-10-05 12:03 ` [PATCH v2 6/7] s390/pci: Set MSI_FLAG_NO_AFFINITY at IRQ init time Tobias Schumacher
2026-10-05 12:08   ` sashiko-bot
2026-10-06 15:33   ` Niklas Schnelle
2026-10-05 12:03 ` [PATCH v2 7/7] s390/pci: Drop the unused index argument of zpci_msi_clear_airq() Tobias Schumacher
2026-10-05 12:08   ` sashiko-bot
2026-10-06 15:28   ` Niklas Schnelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DLYDNZO7F3C0.2X767HD7G8PDZ@linux.ibm.com \
    --to=ts@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=alifm@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=gbayer@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=julianr@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mjrosato@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=schnelle@linux.ibm.com \
    --cc=svens@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.