virtio: release virtio index when fail to device_register
authorweiping zhang <zwp10758@gmail.com>
Wed, 29 Nov 2017 01:23:01 +0000 (09:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Dec 2017 08:28:10 +0000 (09:28 +0100)
commit893fab0c338b16724fc67bcbd3b95f5bc97108f6
tree370eb01edef3e2286f213b9196f3636c1b7d64d4
parent4b4e6f675846c0700fae441f30bcb18dca074af7
virtio: release virtio index when fail to device_register

commit e60ea67bb60459b95a50a156296041a13e0e380e upstream.

index can be reused by other virtio device.

Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/virtio/virtio.c