Commit f658866
KVM: fix memory leak in kvm_io_bus_unregister_dev()
when kmalloc() fails in kvm_io_bus_unregister_dev(), before removing
the bus, we should iterate over all other devices linked to it and call
kvm_iodevice_destructor() for them
Fixes: 90db104 ("KVM: kvm_io_bus_unregister_dev() should never fail")
Cc: [email protected]
Reported-and-tested-by: [email protected]
Link: https://syzkaller.appspot.com/bug?extid=f196caa45793d6374707
Signed-off-by: Rustam Kovhaev <[email protected]>
Reviewed-by: Vitaly Kuznetsov <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>1 parent 0f99022 commit f658866
1 file changed
+12
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4332 | 4332 | | |
4333 | 4333 | | |
4334 | 4334 | | |
4335 | | - | |
| 4335 | + | |
4336 | 4336 | | |
4337 | 4337 | | |
4338 | 4338 | | |
| |||
4349 | 4349 | | |
4350 | 4350 | | |
4351 | 4351 | | |
4352 | | - | |
| 4352 | + | |
| 4353 | + | |
| 4354 | + | |
| 4355 | + | |
| 4356 | + | |
| 4357 | + | |
4353 | 4358 | | |
4354 | | - | |
| 4359 | + | |
| 4360 | + | |
| 4361 | + | |
| 4362 | + | |
| 4363 | + | |
4355 | 4364 | | |
4356 | 4365 | | |
4357 | | - | |
4358 | | - | |
4359 | | - | |
4360 | | - | |
4361 | | - | |
4362 | | - | |
4363 | 4366 | | |
4364 | 4367 | | |
4365 | 4368 | | |
| |||
0 commit comments