Skip to content
Snippets Groups Projects
Commit 5ea5ca3c authored by Wei Wang's avatar Wei Wang Committed by Sean Christopherson
Browse files

KVM: destruct kvm_io_device while unregistering it from kvm_io_bus


Current usage of kvm_io_device requires users to destruct it with an extra
call of kvm_iodevice_destructor after the device gets unregistered from
kvm_io_bus. This is not necessary and can cause errors if a user forgot
to make the extra call.

Simplify the usage by combining kvm_iodevice_destructor into
kvm_io_bus_unregister_dev. This reduces LOCs a bit for users and can
avoid the leakage of destructing the device explicitly.

Signed-off-by: default avatarWei Wang <wei.w.wang@intel.com>
Reviewed-by: default avatarSean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20230207123713.3905-2-wei.w.wang@intel.com


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 5f643e46
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment