virtio_console: reset on out of memory
authorMichael S. Tsirkin <mst@redhat.com>
Fri, 20 Apr 2018 18:00:13 +0000 (21:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 May 2018 19:58:12 +0000 (12:58 -0700)
commit998d43ce034b98466e0aa1b8d56b6d524c7d0d4e
tree438a23337e4bc3fae482ef8692bd93cbcdb8f99c
parente9287108acce9b3611bc45a76801fbe242347e60
virtio_console: reset on out of memory

commit 5c60300d68da32ca77f7f978039dc72bfc78b06b upstream.

When out of memory and we can't add ctrl vq buffers,
probe fails. Unfortunately the error handling is
out of spec: it calls del_vqs without bothering
to reset the device first.

To fix, call the full cleanup function in this case.

Cc: stable@vger.kernel.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/virtio_console.c