diff options
author | Julien Thierry <julien.thierry@arm.com> | 2018-08-14 18:03:56 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2018-08-16 11:30:18 +0100 |
commit | 971ba8ccff299dd41b0e2db655a6b99f3eb2ae0b (patch) | |
tree | 2489384e9d1a50ab796351cc7fdea39f9498e31f | |
parent | dc4291bae21842dedbf7a10091ebbfec29ecfbd2 (diff) | |
download | kvmtool-971ba8ccff299dd41b0e2db655a6b99f3eb2ae0b.tar.gz |
ioport: unregister port device when unregistering port
Ioport register bus devices when they registered. These devices are not
unregistered when the ioports entries containing their headers are
unregistered. This results in dangling pointers in the device rb_tree.
Unregister ioport bus devices when the ioport is unregistered.
Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | ioport.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -133,6 +133,7 @@ int ioport__unregister(struct kvm *kvm, u16 port) if (!entry) goto done; + device__unregister(&entry->dev_hdr); ioport_remove(&ioport_tree, entry); free(entry); @@ -155,6 +156,7 @@ static void ioport__unregister_all(void) while (rb) { rb_node = rb_int(rb); entry = ioport_node(rb_node); + device__unregister(&entry->dev_hdr); ioport_remove(&ioport_tree, entry); free(entry); rb = rb_first(&ioport_tree); |