diff options
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/net.c | 5 | ||||
-rw-r--r-- | drivers/vhost/vhost.c | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 4b4da5b86ff9..f442668a1e52 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -129,8 +129,9 @@ static void handle_tx(struct vhost_net *net) | |||
129 | size_t hdr_size; | 129 | size_t hdr_size; |
130 | struct socket *sock; | 130 | struct socket *sock; |
131 | 131 | ||
132 | sock = rcu_dereference_check(vq->private_data, | 132 | /* TODO: check that we are running from vhost_worker? |
133 | lockdep_is_held(&vq->mutex)); | 133 | * Not sure it's worth it, it's straight-forward enough. */ |
134 | sock = rcu_dereference_check(vq->private_data, 1); | ||
134 | if (!sock) | 135 | if (!sock) |
135 | return; | 136 | return; |
136 | 137 | ||
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 94701ff3a23a..159c77a5746f 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
@@ -884,6 +884,7 @@ static int log_write(void __user *log_base, | |||
884 | int r; | 884 | int r; |
885 | if (!write_length) | 885 | if (!write_length) |
886 | return 0; | 886 | return 0; |
887 | write_length += write_address % VHOST_PAGE_SIZE; | ||
887 | write_address /= VHOST_PAGE_SIZE; | 888 | write_address /= VHOST_PAGE_SIZE; |
888 | for (;;) { | 889 | for (;;) { |
889 | u64 base = (u64)(unsigned long)log_base; | 890 | u64 base = (u64)(unsigned long)log_base; |
@@ -897,7 +898,7 @@ static int log_write(void __user *log_base, | |||
897 | if (write_length <= VHOST_PAGE_SIZE) | 898 | if (write_length <= VHOST_PAGE_SIZE) |
898 | break; | 899 | break; |
899 | write_length -= VHOST_PAGE_SIZE; | 900 | write_length -= VHOST_PAGE_SIZE; |
900 | write_address += VHOST_PAGE_SIZE; | 901 | write_address += 1; |
901 | } | 902 | } |
902 | return r; | 903 | return r; |
903 | } | 904 | } |