aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vhost/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/vhost/net.c')
-rw-r--r--drivers/vhost/net.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 9b3ca103135f..f616cefc95ba 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -128,8 +128,7 @@ static void handle_tx(struct vhost_net *net)
128 size_t hdr_size; 128 size_t hdr_size;
129 struct socket *sock; 129 struct socket *sock;
130 130
131 /* TODO: check that we are running from vhost_worker? 131 /* TODO: check that we are running from vhost_worker? */
132 * Not sure it's worth it, it's straight-forward enough. */
133 sock = rcu_dereference_check(vq->private_data, 1); 132 sock = rcu_dereference_check(vq->private_data, 1);
134 if (!sock) 133 if (!sock)
135 return; 134 return;
@@ -306,7 +305,8 @@ static void handle_rx_big(struct vhost_net *net)
306 size_t len, total_len = 0; 305 size_t len, total_len = 0;
307 int err; 306 int err;
308 size_t hdr_size; 307 size_t hdr_size;
309 struct socket *sock = rcu_dereference(vq->private_data); 308 /* TODO: check that we are running from vhost_worker? */
309 struct socket *sock = rcu_dereference_check(vq->private_data, 1);
310 if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) 310 if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue))
311 return; 311 return;
312 312
@@ -415,7 +415,8 @@ static void handle_rx_mergeable(struct vhost_net *net)
415 int err, headcount; 415 int err, headcount;
416 size_t vhost_hlen, sock_hlen; 416 size_t vhost_hlen, sock_hlen;
417 size_t vhost_len, sock_len; 417 size_t vhost_len, sock_len;
418 struct socket *sock = rcu_dereference(vq->private_data); 418 /* TODO: check that we are running from vhost_worker? */
419 struct socket *sock = rcu_dereference_check(vq->private_data, 1);
419 if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) 420 if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue))
420 return; 421 return;
421 422