]> git.baikalelectronics.ru Git - kernel.git/commit
vhost_net: correct error handling in vhost_net_set_backend()
authorJason Wang <jasowang@redhat.com>
Mon, 28 Jan 2013 01:05:17 +0000 (01:05 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Jan 2013 20:43:03 +0000 (15:43 -0500)
commit7e88972a0f04002bf25ea39a912087848ef1c99c
treec25929f71faec4963eafa1cfbeb992bee6cd4720
parent6871157dfff8bd7827348bd29d211d810f1b7e9c
vhost_net: correct error handling in vhost_net_set_backend()

Currently, when vhost_init_used() fails the sock refcnt and ubufs were
leaked. Correct this by calling vhost_init_used() before assign ubufs and
restore the oldsock when it fails.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/vhost/net.c