When totem callback is called before setting value, NULL can be called,
resulting in segfault.

Signed-off-by: Jan Friesse <[email protected]>
---
 exec/schedwrk.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/exec/schedwrk.c b/exec/schedwrk.c
index 0591063..e7ffe92 100644
--- a/exec/schedwrk.c
+++ b/exec/schedwrk.c
@@ -118,6 +118,10 @@ static int schedwrk_internal_create (
                goto error_destroy;
        }
 
+       instance->schedwrk_fn = schedwrk_fn;
+       instance->context = context;
+       instance->lock = lock;
+
        totempg_callback_token_create (
                &instance->callback_handle,
                TOTEM_CALLBACK_TOKEN_SENT,
@@ -125,10 +129,6 @@ static int schedwrk_internal_create (
                schedwrk_do,
                handle2void (*handle));
 
-       instance->schedwrk_fn = schedwrk_fn;
-       instance->context = context;
-       instance->lock = lock;
-
         hdb_handle_put (&schedwrk_instance_database, *handle);
 
        return (0);
-- 
1.7.1

_______________________________________________
discuss mailing list
[email protected]
http://lists.corosync.org/mailman/listinfo/discuss

Reply via email to