[libvirt] [PATCH] virConnectUnregisterCloseCallback: Unlock @conn prior to error dispatch

Eric Blake eblake at redhat.com
Tue Jan 7 17:42:06 UTC 2014


On 01/07/2014 10:25 AM, Michal Privoznik wrote:
> The function checks for @conn to be valid and locks its mutex. Then, it
> checks if callee is unregistering the same callback that he registered
> previously. If this fails an error is reported and  the control jumps to
> 'error' label. Here, if @conn has some errors (and it certainly does -
> the one that's been just reported) the conn->mutex is locked again -
> without any previous unlock:

ACK; bug introduced in commit ca0ea2a.

> +++ b/src/libvirt.c
> @@ -21022,9 +21022,9 @@ virConnectUnregisterCloseCallback(virConnectPtr conn,
>      return 0;
>  
>  error:
> -    virDispatchError(conn);
>      virObjectUnlock(conn->closeCallback);
>      virMutexUnlock(&conn->lock);
> +    virDispatchError(conn);
>      return -1;
>  }
>  
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140107/baacc914/attachment-0001.sig>


More information about the libvir-list mailing list