diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-03-23 14:56:33 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-03-23 14:56:33 +0100 |
commit | 85ae01b2da0ed606a2e8d840aadef90fd30220a1 (patch) | |
tree | f9eaa974b88b9db09dab9e5f6876e87d12543fe4 /drivers/vhost/net.c | |
parent | 6407d474e6ae6a798fa5ba40b32f508a52de80ff (diff) | |
parent | 306ff3e473a970f88680e8355c0900fcab0357e2 (diff) | |
download | kernel_samsung_aries-85ae01b2da0ed606a2e8d840aadef90fd30220a1.zip kernel_samsung_aries-85ae01b2da0ed606a2e8d840aadef90fd30220a1.tar.gz kernel_samsung_aries-85ae01b2da0ed606a2e8d840aadef90fd30220a1.tar.bz2 |
Merge remote branch 'alsa/devel' into topic/usb
Diffstat (limited to 'drivers/vhost/net.c')
-rw-r--r-- | drivers/vhost/net.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index ad37da2..a6a88df 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -125,7 +125,7 @@ static void handle_tx(struct vhost_net *net) mutex_lock(&vq->mutex); vhost_disable_notify(vq); - if (wmem < sock->sk->sk_sndbuf * 2) + if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); hdr_size = vq->hdr_size; @@ -508,12 +508,12 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) /* Verify that ring has been setup correctly. */ if (!vhost_vq_access_ok(vq)) { r = -EFAULT; - goto err; + goto err_vq; } sock = get_socket(fd); if (IS_ERR(sock)) { r = PTR_ERR(sock); - goto err; + goto err_vq; } /* start polling new socket */ @@ -524,12 +524,14 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) vhost_net_disable_vq(n, vq); rcu_assign_pointer(vq->private_data, sock); vhost_net_enable_vq(n, vq); - mutex_unlock(&vq->mutex); done: if (oldsock) { vhost_net_flush_vq(n, index); fput(oldsock->file); } + +err_vq: + mutex_unlock(&vq->mutex); err: mutex_unlock(&n->dev.mutex); return r; |