mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jürgen Groß" <jgross@suse.com>
To: Dominique Martinet <asmadeus@codewreck.org>,
	Alexander Merritt <alexander@edera.dev>
Cc: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	Eric Van Hensbergen <ericvh@kernel.org>,
	Latchesar Ionkov <lucho@ionkov.net>,
	Christian Schoenebeck <linux_oss@crudebyte.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Alex Zenla <alex@edera.dev>,
	Ariadne Conill <ariadne@ariadne.space>
Subject: Re: [PATCH] 9p/xen: fix release of IRQ
Date: Fri, 22 Nov 2024 14:54:06 +0100	[thread overview]
Message-ID: <a6570b47-217c-4e92-a64c-16fc34494e3e@suse.com> (raw)
In-Reply-To: <Zz_F9wMda68xhvKa@codewreck.org>


[-- Attachment #1.1.1: Type: text/plain, Size: 2292 bytes --]

On 22.11.24 00:44, Dominique Martinet wrote:
> Alexander Merritt wrote on Thu, Nov 21, 2024 at 10:51:00PM +0000:
>> From: Alex Zenla <alex@edera.dev>
>>
>> Kernel logs indicate an IRQ was double-freed.
> 
> Nit: if you still have the log it'd be great to include it in the commit
> message, rather than paragraphing it.
> 
> The rationale is that someone with the same problem will likely just
> search for the error as is first, and having it in the commit log will
> be an easy hit.
> 
> (This alone wouldn't need a resend, I can add it if you just reply to
> the mail with it; it's also fine if you no longer have the log, that'll
> be a remark for the next patch)
> 
> 
>>
>> Pass correct device ID during IRQ release.
>>
>> Fixes: 71ebd71921e45 ("xen/9pfs: connect to the backend")
>> Signed-off-by: Alex Zenla <alex@edera.dev>
>> Signed-off-by: Alexander Merritt <alexander@edera.dev>
>> Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
> 
> 
> 
>> ---
>>   net/9p/trans_xen.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c
>> index dfdbe1ca5338..198d46d79d84 100644
>> --- a/net/9p/trans_xen.c
>> +++ b/net/9p/trans_xen.c
>> @@ -286,7 +286,8 @@ static void xen_9pfs_front_free(struct xen_9pfs_front_priv *priv)
>>   		if (!priv->rings[i].intf)
>>   			break;
>>   		if (priv->rings[i].irq > 0)
>> -			unbind_from_irqhandler(priv->rings[i].irq, priv->dev);
>> +			unbind_from_irqhandler(priv->rings[i].irq, ring);
>> +		priv->rings[i].evtchn = priv->rings[i].irq = 0;
> 
> (style) I don't recall seeing much `a = b = 0` in the kernel, and
> looking at it checkpatch seems to complain:
> CHECK: multiple assignments should be avoided
> #114: FILE: net/9p/trans_xen.c:290:
> +		priv->rings[i].evtchn = priv->rings[i].irq = 0;
> 
> Please run checkpatch on the patches you send (b4 can do it for you if
> you want to start using it)
> 
> 
> code-wise,
> I also don't see where unbinf_from_irqhandler would free the evtchn, so
> is it leaking here, or is it implicit from something else?
> We only free it explicitly on error binding the irq.

unbind_from_irqhandler()
   unbind_from_irq()
     __unbind_from_irq()
       close_evtchn()


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2024-11-22 13:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-21 22:51 Alexander Merritt
2024-11-21 23:44 ` Dominique Martinet
2024-11-22 13:54   ` Jürgen Groß [this message]
2024-11-22 14:35     ` Dominique Martinet
2024-11-22  7:41 ` Jürgen Groß

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=a6570b47-217c-4e92-a64c-16fc34494e3e@suse.com \
    --to=jgross@suse.com \
    --cc=alex@edera.dev \
    --cc=alexander@edera.dev \
    --cc=ariadne@ariadne.space \
    --cc=asmadeus@codewreck.org \
    --cc=ericvh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --cc=sstabellini@kernel.org \
    --cc=v9fs@lists.linux.dev \
    --cc=xen-devel@lists.xenproject.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®