aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-06-02 11:26:36 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-02 11:26:36 -0400
commit0dea7c12fc2c15de8b2104a322a1f47919d753fd (patch)
treef6f2082164d3a1fcfe3359d02beb6f19917d4c08 /drivers
parentab95bfe01f9872459c8678572ccadbf646badad0 (diff)
parentf8322fbe049687d3676690e8ad839c7169dd306a (diff)
Merge branch 'vhost-net-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Diffstat (limited to 'drivers')
-rw-r--r--drivers/vhost/net.c13
-rw-r--r--drivers/vhost/vhost.c4
2 files changed, 8 insertions, 9 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 0f41c9195e9b..4c218e910635 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -519,13 +519,12 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
519 519
520 /* start polling new socket */ 520 /* start polling new socket */
521 oldsock = vq->private_data; 521 oldsock = vq->private_data;
522 if (sock == oldsock) 522 if (sock != oldsock){
523 goto done; 523 vhost_net_disable_vq(n, vq);
524 rcu_assign_pointer(vq->private_data, sock);
525 vhost_net_enable_vq(n, vq);
526 }
524 527
525 vhost_net_disable_vq(n, vq);
526 rcu_assign_pointer(vq->private_data, sock);
527 vhost_net_enable_vq(n, vq);
528done:
529 if (oldsock) { 528 if (oldsock) {
530 vhost_net_flush_vq(n, index); 529 vhost_net_flush_vq(n, index);
531 fput(oldsock->file); 530 fput(oldsock->file);
@@ -626,7 +625,7 @@ static long vhost_net_compat_ioctl(struct file *f, unsigned int ioctl,
626} 625}
627#endif 626#endif
628 627
629const static struct file_operations vhost_net_fops = { 628static const struct file_operations vhost_net_fops = {
630 .owner = THIS_MODULE, 629 .owner = THIS_MODULE,
631 .release = vhost_net_release, 630 .release = vhost_net_release,
632 .unlocked_ioctl = vhost_net_ioctl, 631 .unlocked_ioctl = vhost_net_ioctl,
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 3b83382e06eb..04344b711c56 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;