virtio: console: fix error handling in init() function
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Sat, 1 Sep 2012 19:49:37 +0000 (23:49 +0400)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 28 Sep 2012 05:35:13 +0000 (15:05 +0930)
commit33e1afc3d82697599ccc8dc8f2fa44ffff5ae329
treeb4b1c2b403a9b8a9a84c2a7d90e234b0703bec63
parent5b8fa822b71fa91b17c9fb38bcca31e771f7650d
virtio: console: fix error handling in init() function

If register_virtio_driver() fails, virtio-ports class is not destroyed.
The patch adds error handling of register_virtio_driver().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/char/virtio_console.c