]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
virtio-mmio: fix missing put_device() when vm_cmdline_parent registration failed
authorchengkaitao <pilgrimtao@gmail.com>
Thu, 2 Jun 2022 00:55:42 +0000 (08:55 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 09:45:17 +0000 (11:45 +0200)
commit78b34fd0d7546bf9daae995855609363be770343
tree34d36795ce9f2397f75f20e69256416fb79b9777
parent228ecc2ae817bb5849a45d1af61e504de08ba6dc
virtio-mmio: fix missing put_device() when vm_cmdline_parent registration failed

[ Upstream commit a58a7f97ba11391d2d0d408e0b24f38d86ae748e ]

The reference must be released when device_register(&vm_cmdline_parent)
failed. Add the corresponding 'put_device()' in the error handling path.

Signed-off-by: chengkaitao <pilgrimtao@gmail.com>
Message-Id: <20220602005542.16489-1-chengkaitao@didiglobal.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/virtio/virtio_mmio.c