virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Asias He <asias@redhat.com>
Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org,
	target-devel@vger.kernel.org,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v8 2/3] tcm_vhost: Add hotplug/hotunplug support
Date: Wed, 24 Apr 2013 13:51:19 +0300	[thread overview]
Message-ID: <20130424105119.GA12865@redhat.com> (raw)
In-Reply-To: <20130424100625.GA19845@hj.localdomain>

On Wed, Apr 24, 2013 at 06:06:25PM +0800, Asias He wrote:
> > > +{
> > > +
> > > +	struct vhost_scsi *vs = tpg->vhost_scsi;
> > > +	struct vhost_virtqueue *vq;
> > > +	u32 reason;
> > > +	int ret;
> > > +
> > > +	mutex_lock(&tpg->tv_tpg_mutex);
> > > +	vs = tpg->vhost_scsi;
> > > +	mutex_unlock(&tpg->tv_tpg_mutex);
> > > +	if (!vs)
> > > +		return -ENODEV;
> > > +
> > 
> > What if clear_endpoint and close happen at this
> > point? Can vhost_scsi go away so tcm_vhost_check_feature
> > references freed memory?
> 
> There is no easy way to handle this.

Take a reference somewhere so this can't happen?

  parent reply	other threads:[~2013-04-24 10:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-24  3:32 [PATCH v8 0/3] tcm_vhost hotplug Asias He
2013-04-24  3:32 ` [PATCH v8 1/3] tcm_vhost: Introduce tcm_vhost_check_feature() Asias He
2013-04-24  3:32 ` [PATCH v8 2/3] tcm_vhost: Add hotplug/hotunplug support Asias He
2013-04-24  9:18   ` Michael S. Tsirkin
2013-04-24 10:06     ` Asias He
2013-04-24 10:41       ` Michael S. Tsirkin
2013-04-24 10:51       ` Michael S. Tsirkin [this message]
2013-04-24  3:32 ` [PATCH v8 3/3] tcm_vhost: Add ioctl to get and set events missed flag Asias He
     [not found] ` <1366774344-11127-4-git-send-email-asias@redhat.com>
2013-04-24  9:33   ` 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=20130424105119.GA12865@redhat.com \
    --to=mst@redhat.com \
    --cc=asias@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=target-devel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).