.. | .. |
---|
187 | 187 | r = kvm_io_bus_unregister_dev(kvm, |
---|
188 | 188 | zone->pio ? KVM_PIO_BUS : KVM_MMIO_BUS, &dev->dev); |
---|
189 | 189 | |
---|
| 190 | + kvm_iodevice_destructor(&dev->dev); |
---|
| 191 | + |
---|
190 | 192 | /* |
---|
191 | 193 | * On failure, unregister destroys all devices on the |
---|
192 | 194 | * bus _except_ the target device, i.e. coalesced_zones |
---|
193 | | - * has been modified. No need to restart the walk as |
---|
194 | | - * there aren't any zones left. |
---|
| 195 | + * has been modified. Bail after destroying the target |
---|
| 196 | + * device, there's no need to restart the walk as there |
---|
| 197 | + * aren't any zones left. |
---|
195 | 198 | */ |
---|
196 | 199 | if (r) |
---|
197 | 200 | break; |
---|
198 | | - kvm_iodevice_destructor(&dev->dev); |
---|
199 | 201 | } |
---|
200 | 202 | } |
---|
201 | 203 | |
---|