2014-07-04 19:44 GMT+04:00, Ján Veselý <[email protected]>:
> yes, all the error paths in that function seem to miss mutex unlock,
> fell free to send a patch
>
> jan
>
> On Fri, Jul 4, 2014 at 11:35 AM, Wolf Ramovsky <[email protected]>
> wrote:
>> You can see that mutex get locked here [1], but doesn't get unlocked
>> e.g. here [2] and below.
>>
>> [1]
>> http://bazaar.launchpad.net/~helenos-core/helenos/mainline/view/head:/uspace/srv/hid/compositor/compositor.c#L890
>> [2]
>> http://bazaar.launchpad.net/~helenos-core/helenos/mainline/view/head:/uspace/srv/hid/compositor/compositor.c#L893
>>
>> _______________________________________________
>> HelenOS-devel mailing list
>> [email protected]
>> http://lists.modry.cz/listinfo/helenos-devel
>
> _______________________________________________
> HelenOS-devel mailing list
> [email protected]
> http://lists.modry.cz/listinfo/helenos-devel
>
=== modified file 'uspace/srv/hid/compositor/compositor.c'
--- uspace/srv/hid/compositor/compositor.c	2014-03-01 23:05:38 +0000
+++ uspace/srv/hid/compositor/compositor.c	2014-07-04 18:58:58 +0000
@@ -891,6 +891,7 @@
 
 			window_t *win = window_create();
 			if (!win) {
+				fibril_mutex_unlock(&window_list_mtx);
 				async_answer_2(callid, ENOMEM, 0, 0);
 				return;
 			}
@@ -906,12 +907,14 @@
 			++window_id;
 
 			if (loc_service_register(name_in, &win->in_dsid) != EOK) {
+				fibril_mutex_unlock(&window_list_mtx);
 				window_destroy(win);
 				async_answer_2(callid, EINVAL, 0, 0);
 				return;
 			}
 
 			if (loc_service_register(name_out, &win->out_dsid) != EOK) {
+				fibril_mutex_unlock(&window_list_mtx);
 				loc_service_unregister(win->in_dsid);
 				window_destroy(win);
 				async_answer_2(callid, EINVAL, 0, 0);

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to