]> git.baikalelectronics.ru Git - kernel.git/commit
virtio_mmio: add cleanup for virtio_mmio_probe
authorweiping zhang <zhangweiping@didichuxing.com>
Wed, 6 Dec 2017 13:59:16 +0000 (21:59 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 7 Dec 2017 16:30:50 +0000 (18:30 +0200)
commit92d5ecbabe00dc719f803f6147c52d10f1927153
tree38ef83887dd988fe7ea05a07d0f3ec1ac8461c26
parente0571ed12c43d49c802027f905b40760bb06aef1
virtio_mmio: add cleanup for virtio_mmio_probe

As mentioned at drivers/base/core.c:
/*
 * NOTE: _Never_ directly free @dev after calling this function, even
 * if it returned an error! Always use put_device() to give up the
 * reference initialized in this function instead.
 */
so we don't free vm_dev until vm_dev.dev.release be called.

Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
drivers/virtio/virtio_mmio.c