All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: "Michael S. Tsirkin" <mst@redhat.com>
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 14:10:31 +0930	[thread overview]
Message-ID: <200907231410.32287.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20090721155925.GC3306@redhat.com>

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.  I think with some cleanups, that loop in 
vp_free_vectors might go away, too.

Rusty.



  reply	other threads:[~2009-07-23  4:40 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-23  4:40   ` Rusty Russell [this message]
2009-07-23  9:08     ` Michael S. Tsirkin
2009-07-23  9:08     ` Michael S. Tsirkin
2009-07-23 10:20     ` Michael S. Tsirkin
2009-07-23 10:20     ` Michael S. Tsirkin
2009-07-23  4:40   ` Rusty Russell
2009-07-21 15:59 ` 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=200907231410.32287.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cotte@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --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.