All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	virtualization@lists.linux-foundation.org,
	Anthony Liguori <anthony@codemonkey.ws>,
	kvm@vger.kernel.org, avi@redhat.com,
	Carsten Otte <cotte@de.ibm.com>
Subject: Re: [PATCH 2/2] virtio: fix double free_irq
Date: Thu, 23 Jul 2009 13:20:52 +0300	[thread overview]
Message-ID: <20090723102052.GC10860@redhat.com> (raw)
In-Reply-To: <200907231410.32287.rusty@rustcorp.com.au>

On Thu, Jul 23, 2009 at 02:10:31PM +0930, Rusty Russell wrote:
> On Wed, 22 Jul 2009 01:29:25 am Michael S. Tsirkin wrote:
> > -	if (info->vector != VIRTIO_MSI_NO_VECTOR)
> > +	if (info->vector != VIRTIO_MSI_NO_VECTOR) {
> >  		free_irq(vp_dev->msix_entries[info->vector].vector, vq);
> > +		--vp_dev->msix_used_vectors;
> > +	}
> >
> 
> This only works because the only current caller of vp_del_vq is vp_del_vqs, so 
> msix_used_vectors will be 0 after all the queues have been freed.
> 
> Make up your mind.  Either find_vq allocates and del_vq frees, or it's find_vqs 
> and del_vqs.  I suggest the former, and setting the value VIRTIO_MSI_NO_VECTOR  
> to indicate it's already freed.

Hmm, there's nowhere to set this value: del_vq does kfree on info.
But I think I see a solution. Cleaned up patch RSN.

> I think with some cleanups, that loop in vp_free_vectors might go away, too.

Hmm, I don't see how, yet.
It's there to free the common vectors: config and shared vq vector.

> Rusty.
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2009-07-23 10:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1248181714.git.mst@redhat.com>
2009-07-21 15:59 ` [PATCH 1/2] virtio: fix memory leak on device removal Michael S. Tsirkin
2009-07-21 15:59 ` Michael S. Tsirkin
2009-07-21 16:03   ` Michael S. Tsirkin
2009-07-21 16:03   ` Michael S. Tsirkin
2009-07-23  4:26   ` Rusty Russell
2009-07-23  4:26   ` Rusty Russell
2009-07-23 10:27     ` Michael S. Tsirkin
2009-07-23 10:27     ` Michael S. Tsirkin
2009-07-21 15:59 ` [PATCH 2/2] virtio: fix double free_irq Michael S. Tsirkin
2009-07-21 15:59 ` Michael S. Tsirkin
2009-07-23  4:40   ` Rusty Russell
2009-07-23  4:40   ` Rusty Russell
2009-07-23  9:08     ` Michael S. Tsirkin
2009-07-23  9:08     ` Michael S. Tsirkin
2009-07-23 10:20     ` Michael S. Tsirkin [this message]
2009-07-23 10:20     ` Michael S. Tsirkin

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=20090723102052.GC10860@redhat.com \
    --to=mst@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cotte@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=virtualization@lists.linux-foundation.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 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.