Skip to content

Commit

Permalink
vhost/net: fix rcu check usage
Browse files Browse the repository at this point in the history
Incorrect rcu check was used as rcu isn't done
under mutex here. Force check to 1 for now,
to stop it from complaining.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
Michael S. Tsirkin committed Nov 25, 2010
1 parent a27e13d commit 11cd1a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/vhost/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ static void handle_tx(struct vhost_net *net)
size_t hdr_size;
struct socket *sock;

sock = rcu_dereference_check(vq->private_data,
lockdep_is_held(&vq->mutex));
/* TODO: check that we are running from vhost_worker?
* Not sure it's worth it, it's straight-forward enough. */
sock = rcu_dereference_check(vq->private_data, 1);
if (!sock)
return;

Expand Down

0 comments on commit 11cd1a8

Please sign in to comment.