From: Simon Wilkinson Date: Thu, 21 Feb 2013 19:34:47 +0000 (+0000) Subject: Unix CM: Catch ICL initialisation failures X-Git-Tag: upstream/1.6.3^2~82 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=86c3a3b7ea14e06bd89eaccab51da12a9b7ed2a3;p=packages%2Fo%2Fopenafs.git Unix CM: Catch ICL initialisation failures If afs_icl_CreateLog fails, don't still call afS_icl_CreateSet. If afs_icl_CreateSetWithFlags fails, don't ignore its error code. Caught by clang-analyzer Reviewed-on: http://gerrit.openafs.org/9203 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Jeffrey Altman (cherry picked from commit 3bbff16c6d34c905fab8fcb792c8606ea356e2a8) Change-Id: I4835a6cbdc802bc08f5ae83fa10f9c93357cf736 Reviewed-on: http://gerrit.openafs.org/9532 Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand Reviewed-by: Derrick Brashear Tested-by: BuildBot --- diff --git a/src/afs/afs_icl.c b/src/afs/afs_icl.c index 2c82f2120..63fa1eab5 100644 --- a/src/afs/afs_icl.c +++ b/src/afs/afs_icl.c @@ -83,14 +83,17 @@ afs_icl_InitLogs(void) /* initialize the ICL system */ code = afs_icl_CreateLog("cmfx", 60 * 1024, &logp); - if (code == 0) - code = - afs_icl_CreateSetWithFlags("cm", logp, NULL, - ICL_CRSET_FLAG_DEFAULT_OFF, - &afs_iclSetp); - code = - afs_icl_CreateSet("cmlongterm", logp, NULL, - &afs_iclLongTermSetp); + if (code) + return code; + + code = afs_icl_CreateSetWithFlags("cm", logp, NULL, + ICL_CRSET_FLAG_DEFAULT_OFF, + &afs_iclSetp); + if (code) + return code; + + code = afs_icl_CreateSet("cmlongterm", logp, NULL, + &afs_iclLongTermSetp); return code; }