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>
Thu, 28 Nov 2019 17:29:04 +0000 (18:29 +0100)
commit8688e0d2018a4b1161c1c679a4fd4ce83a3265e0
tree2cd5ea65a174f986a643495dd47ab4fd5f2d62c1
parent8c99399fe8b3985ac2660fba7f22d6d859ed1658
virtio_console: reset on out of memory

[ Upstream commit 5c60300d68da32ca77f7f978039dc72bfc78b06b ]

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: Sasha Levin <sashal@kernel.org>
drivers/char/virtio_console.c