]> git.baikalelectronics.ru Git - kernel.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)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 8 Jun 2022 12:56:03 +0000 (08:56 -0400)
commit3ded066d5199d29e87a4b182bc0003aa77b1c80b
tree350a294cc0bb86c64b5f341e3d8bbf78443f3ccc
parentf15101ca093002afaf69c1c1a5f8a31ff765cebf
virtio-mmio: fix missing put_device() when vm_cmdline_parent registration failed

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>
drivers/virtio/virtio_mmio.c