diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-03-05 20:39:00 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-04-01 23:19:10 -0400 |
commit | 09aaacf02a3e88870ed5cad038a5bc822c947904 (patch) | |
tree | ad8eadd88ed239d9a381cf71a7d7752d69f6920f /drivers | |
parent | 964ea96ebaa4014a3d4bc9d6950b460899e3814d (diff) |
vhost: don't open-code sockfd_put()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/vhost/net.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index e1e22e0f01e8..be414d2b2b22 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -818,9 +818,9 @@ static int vhost_net_release(struct inode *inode, struct file *f) | |||
818 | vhost_dev_cleanup(&n->dev, false); | 818 | vhost_dev_cleanup(&n->dev, false); |
819 | vhost_net_vq_reset(n); | 819 | vhost_net_vq_reset(n); |
820 | if (tx_sock) | 820 | if (tx_sock) |
821 | fput(tx_sock->file); | 821 | sockfd_put(tx_sock); |
822 | if (rx_sock) | 822 | if (rx_sock) |
823 | fput(rx_sock->file); | 823 | sockfd_put(rx_sock); |
824 | /* Make sure no callbacks are outstanding */ | 824 | /* Make sure no callbacks are outstanding */ |
825 | synchronize_rcu_bh(); | 825 | synchronize_rcu_bh(); |
826 | /* We do an extra flush before freeing memory, | 826 | /* We do an extra flush before freeing memory, |
@@ -860,7 +860,7 @@ static struct socket *get_raw_socket(int fd) | |||
860 | } | 860 | } |
861 | return sock; | 861 | return sock; |
862 | err: | 862 | err: |
863 | fput(sock->file); | 863 | sockfd_put(sock); |
864 | return ERR_PTR(r); | 864 | return ERR_PTR(r); |
865 | } | 865 | } |
866 | 866 | ||
@@ -966,7 +966,7 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) | |||
966 | 966 | ||
967 | if (oldsock) { | 967 | if (oldsock) { |
968 | vhost_net_flush_vq(n, index); | 968 | vhost_net_flush_vq(n, index); |
969 | fput(oldsock->file); | 969 | sockfd_put(oldsock); |
970 | } | 970 | } |
971 | 971 | ||
972 | mutex_unlock(&n->dev.mutex); | 972 | mutex_unlock(&n->dev.mutex); |
@@ -978,7 +978,7 @@ err_used: | |||
978 | if (ubufs) | 978 | if (ubufs) |
979 | vhost_net_ubuf_put_wait_and_free(ubufs); | 979 | vhost_net_ubuf_put_wait_and_free(ubufs); |
980 | err_ubufs: | 980 | err_ubufs: |
981 | fput(sock->file); | 981 | sockfd_put(sock); |
982 | err_vq: | 982 | err_vq: |
983 | mutex_unlock(&vq->mutex); | 983 | mutex_unlock(&vq->mutex); |
984 | err: | 984 | err: |
@@ -1009,9 +1009,9 @@ static long vhost_net_reset_owner(struct vhost_net *n) | |||
1009 | done: | 1009 | done: |
1010 | mutex_unlock(&n->dev.mutex); | 1010 | mutex_unlock(&n->dev.mutex); |
1011 | if (tx_sock) | 1011 | if (tx_sock) |
1012 | fput(tx_sock->file); | 1012 | sockfd_put(tx_sock); |
1013 | if (rx_sock) | 1013 | if (rx_sock) |
1014 | fput(rx_sock->file); | 1014 | sockfd_put(rx_sock); |
1015 | return err; | 1015 | return err; |
1016 | } | 1016 | } |
1017 | 1017 | ||