mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-31 18:15:25 +00:00
virnodedeviceobj: Don't unlock virNodeDeviceObj in virNodeDeviceObjListRemove()
When virNodeDeviceObjListRemove() is called, the passed virNodeDeviceObj is removed from internal list of node devices and then unrefed and unlocked. While the former is warranted (the object was refed at the beginning of the function) the unlock is not. In fact, it's wrong from conceptual POV. We still want threads working on the object tu mutually exclude each other. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
41e878859a
commit
39ac285c6b
@ -524,7 +524,7 @@ virNodeDeviceObjListRemove(virNodeDeviceObjList *devs,
|
||||
virObjectRWLockWrite(devs);
|
||||
virObjectLock(obj);
|
||||
virNodeDeviceObjListRemoveLocked(devs, obj);
|
||||
virNodeDeviceObjEndAPI(&obj);
|
||||
virObjectUnref(obj);
|
||||
virObjectRWUnlock(devs);
|
||||
}
|
||||
|
||||
|
@ -6810,7 +6810,7 @@ testDestroyVport(testDriver *privconn,
|
||||
0);
|
||||
|
||||
virNodeDeviceObjListRemove(privconn->devs, obj);
|
||||
virObjectUnref(obj);
|
||||
virNodeDeviceObjEndAPI(&obj);
|
||||
|
||||
virObjectEventStateQueue(privconn->eventState, event);
|
||||
return 0;
|
||||
@ -7797,8 +7797,6 @@ testNodeDeviceDestroy(virNodeDevicePtr dev)
|
||||
|
||||
virObjectLock(obj);
|
||||
virNodeDeviceObjListRemove(driver->devs, obj);
|
||||
virObjectUnref(obj);
|
||||
obj = NULL;
|
||||
|
||||
cleanup:
|
||||
virNodeDeviceObjEndAPI(&obj);
|
||||
|
Loading…
Reference in New Issue
Block a user