]> git.baikalelectronics.ru Git - kernel.git/commit
vhost: fix error handling in RESET_OWNER ioctl
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 28 Apr 2013 14:12:08 +0000 (17:12 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 1 May 2013 07:02:54 +0000 (10:02 +0300)
commit022a43852f62c8a80539754308cd9a23a74a6ff1
treec708d0c69807c7ac4eb14e86498536c5ec1c6c82
parenta8e8df53c55f804c814873eb2d7357487b221655
vhost: fix error handling in RESET_OWNER ioctl

RESET_OWNER ioctl would leave the fd in a bad state if
memory allocation failed: device is stopped
but owner is not reset. Make state changes
after allocating memory, such that a failed
ioctl has no effect.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/net.c
drivers/vhost/test.c
drivers/vhost/vhost.c
drivers/vhost/vhost.h