]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Unix CM: Catch ICL initialisation failures
authorSimon Wilkinson <sxw@your-file-system.com>
Thu, 21 Feb 2013 19:34:47 +0000 (19:34 +0000)
committerStephan Wiesand <stephan.wiesand@desy.de>
Fri, 22 Mar 2013 23:49:58 +0000 (16:49 -0700)
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 <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 3bbff16c6d34c905fab8fcb792c8606ea356e2a8)

Change-Id: I4835a6cbdc802bc08f5ae83fa10f9c93357cf736
Reviewed-on: http://gerrit.openafs.org/9532
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/afs/afs_icl.c

index 2c82f212011960f29a12ff03db8e8baf19d17c9d..63fa1eab54f340d2060bea4df687007f2740d2b6 100644 (file)
@@ -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;
 }