From: Michael S. Tsirkin Date: Sun, 13 Mar 2011 21:00:52 +0000 (+0200) Subject: vhost-net: remove unlocked use of receive_queue X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=de4d768a428d9de943dd6dc82bcd61742955cb6e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git vhost-net: remove unlocked use of receive_queue Use of skb_queue_empty(&sock->sk->sk_receive_queue) without taking the sk_receive_queue.lock is unsafe or useless. Take it out. Reported-by: Eric Dumazet Signed-off-by: Michael S. Tsirkin --- diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 57203014c457..2f7c76a85e53 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -311,7 +311,7 @@ static void handle_rx(struct vhost_net *net) /* TODO: check that we are running from vhost_worker? */ struct socket *sock = rcu_dereference_check(vq->private_data, 1); - if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) + if (!sock) return; mutex_lock(&vq->mutex);