[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openais
Subject:    [Openais] [PATCH] openais: fix loop in ckpt service dispatch
From:       "Ryan O'Hara" <rohara () redhat ! com>
Date:       2010-01-15 3:29:14
Message-ID: 20100115032914.GA1803 () redhat ! com
[Download RAW message or body]

The saCkptDispatch routine can get into a tight loop if a callback is
undefined (NULL). If callback is NULL, we should simply break out of
the switch statement rather than continue.

Thanks to Christine for finding this problem.

Ryan


["openais_ckpt_dispatch_break.diff" (text/plain)]

Index: ckpt.c
===================================================================
--- ckpt.c	(revision 2097)
+++ ckpt.c	(working copy)
@@ -365,7 +365,7 @@
 		switch (dispatch_data->id) {
 		case MESSAGE_RES_CKPT_CHECKPOINT_CHECKPOINTOPENASYNC:
 			if (callbacks.saCkptCheckpointOpenCallback == NULL) {
-				continue;
+				break;
 			}
 			res_lib_ckpt_checkpointopenasync = (struct res_lib_ckpt_checkpointopenasync *) \
dispatch_data;  
@@ -409,7 +409,7 @@
 
 		case MESSAGE_RES_CKPT_CHECKPOINT_CHECKPOINTSYNCHRONIZEASYNC:
 			if (callbacks.saCkptCheckpointSynchronizeCallback == NULL) {
-				continue;
+				break;
 			}
 
 			res_lib_ckpt_checkpointsynchronizeasync = (struct \
res_lib_ckpt_checkpointsynchronizeasync *) dispatch_data;



_______________________________________________
Openais mailing list
Openais@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/openais

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic