]> rtime.felk.cvut.cz Git - frescor/frsh.git/commitdiff
Do not call qres_cleanup if there has not been qres_init called.
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Tue, 26 May 2009 00:50:49 +0000 (02:50 +0200)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Tue, 26 May 2009 00:50:49 +0000 (02:50 +0200)
The call has been forgotten there during movement of code
to aqcpu_fra_activate(). On the other hand there should
be qres_cleanup if atexit fails.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
resources/cpu_aquosa/lib/aqcpu_fra.c

index 9ea2048f054902690c9d9357d6e032da2f4ee53c..5f3d5bd263104286032143b08d06674f5c9876a9 100644 (file)
@@ -384,8 +384,10 @@ int aqcpu_fra_activate(forb_orb orb)
 
        /* install the cleanup function of th AQuoSA framework as an exit
         * handler function (quite futile but, for now, it's sufficent) */
-       if (atexit(aqcpu_cleanup_wrapper))
+       if (atexit(aqcpu_cleanup_wrapper)) {
+               qres_cleanup();
                return(FRSH_ERR_INTERNAL_ERROR);
+       }
 
        aqcpu_initialized = 1;
 
@@ -436,7 +438,6 @@ int aqcpu_fra_init(void)
        int rv;
 
        if ((rv = fra_register(&aqcpu_allocator))) {
-               qres_cleanup();
                return rv;
        }