From: Asias He Subject: [PATCH V2 4/6] tcm_vhost: Fix vs->vs_endpoint checking in vhost_scsi_handle_vq() Date: Fri, 8 Mar 2013 10:21:45 +0800 Message-ID: <1362709307-12554-5-git-send-email-asias@redhat.com> References: <1362709307-12554-1-git-send-email-asias@redhat.com> Cc: Paolo Bonzini , Stefan Hajnoczi , "Michael S. Tsirkin" , Rusty Russell , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, target-devel@vger.kernel.org, Asias He To: Nicholas Bellinger Return-path: In-Reply-To: <1362709307-12554-1-git-send-email-asias@redhat.com> Sender: target-devel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org vs->vs_endpoint is protected by the vs->dev.mutex. Use tcm_vhost_check_endpoint() to do check. The helper does the needed locking for us. Signed-off-by: Asias He --- drivers/vhost/tcm_vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index b71e946..6739d67 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c @@ -606,7 +606,7 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs, u8 target; /* Must use ioctl VHOST_SCSI_SET_ENDPOINT */ - if (unlikely(!vs->vs_endpoint)) + if (!tcm_vhost_check_endpoint(vs)) return; mutex_lock(&vq->mutex); -- 1.8.1.4