diff options
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/net.c | 12 | ||||
-rw-r--r-- | drivers/vhost/vhost.c | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 2f6185c845e0..7a104e2de3fa 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -527,12 +527,12 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) | |||
527 | 527 | ||
528 | /* start polling new socket */ | 528 | /* start polling new socket */ |
529 | oldsock = vq->private_data; | 529 | oldsock = vq->private_data; |
530 | if (sock == oldsock) | 530 | if (sock != oldsock) { |
531 | goto done; | 531 | vhost_net_disable_vq(n, vq); |
532 | rcu_assign_pointer(vq->private_data, sock); | ||
533 | vhost_net_enable_vq(n, vq); | ||
534 | } | ||
532 | 535 | ||
533 | vhost_net_disable_vq(n, vq); | ||
534 | rcu_assign_pointer(vq->private_data, sock); | ||
535 | vhost_net_enable_vq(n, vq); | ||
536 | done: | 536 | done: |
537 | mutex_unlock(&vq->mutex); | 537 | mutex_unlock(&vq->mutex); |
538 | 538 | ||
@@ -639,7 +639,7 @@ static long vhost_net_compat_ioctl(struct file *f, unsigned int ioctl, | |||
639 | } | 639 | } |
640 | #endif | 640 | #endif |
641 | 641 | ||
642 | const static struct file_operations vhost_net_fops = { | 642 | static const struct file_operations vhost_net_fops = { |
643 | .owner = THIS_MODULE, | 643 | .owner = THIS_MODULE, |
644 | .release = vhost_net_release, | 644 | .release = vhost_net_release, |
645 | .unlocked_ioctl = vhost_net_ioctl, | 645 | .unlocked_ioctl = vhost_net_ioctl, |
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 0b99783083f6..248ed2db0711 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
@@ -237,8 +237,8 @@ static int vq_memory_access_ok(void __user *log_base, struct vhost_memory *mem, | |||
237 | { | 237 | { |
238 | int i; | 238 | int i; |
239 | 239 | ||
240 | if (!mem) | 240 | if (!mem) |
241 | return 0; | 241 | return 0; |
242 | 242 | ||
243 | for (i = 0; i < mem->nregions; ++i) { | 243 | for (i = 0; i < mem->nregions; ++i) { |
244 | struct vhost_memory_region *m = mem->regions + i; | 244 | struct vhost_memory_region *m = mem->regions + i; |