]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
libafscp: Actually return callback from FindCallback
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 19 Feb 2013 17:53:11 +0000 (17:53 +0000)
committerDerrick Brashear <shadow@your-file-system.com>
Fri, 22 Feb 2013 21:03:44 +0000 (13:03 -0800)
Fix FindCallback so that it actually returns the callback that it
found. This requires changing the function prototype so that the
third parameter is passed by reference, and updating the single
call site.

Caught by clang-analyzer

Change-Id: I420647e9cfd119cf1a26456a91d595b8154ddd85
Reviewed-on: http://gerrit.openafs.org/9198
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/libafscp/afscp.h
src/libafscp/afscp_callback.c
src/libafscp/afscp_fid.c

index 743e6bea12a7da93695093d64552a2c5346f9f2a..849cd3d89962ef606fef4778be8bc9cca099ccf5 100644 (file)
@@ -132,7 +132,7 @@ int afscp_CheckCallBack(const struct afscp_venusfid *fid,
                        afs_uint32 *expiretime);
 int afscp_FindCallBack(const struct afscp_venusfid *f,
                       const struct afscp_server *server,
-                      struct afscp_callback *ret);
+                      struct afscp_callback **ret);
 int afscp_AddCallBack(const struct afscp_server *,
                      const struct AFSFid *,
                      const struct AFSFetchStatus *,
index e37221c18f0a7e623f1c313943ac865fe9e5601b..213cc8b5d0c1686bb179e821c125f1f94bfdda99 100644 (file)
@@ -103,7 +103,9 @@ init_afs_cb(void)
 }                              /* init_afs_cb */
 
 int
-afscp_FindCallBack(const struct afscp_venusfid *f, const struct afscp_server *server, struct afscp_callback *ret)
+afscp_FindCallBack(const struct afscp_venusfid *f,
+                  const struct afscp_server *server,
+                  struct afscp_callback **ret)
 {
     int i;
     struct afscp_callback *use = NULL, *cb;
@@ -137,7 +139,7 @@ afscp_FindCallBack(const struct afscp_venusfid *f, const struct afscp_server *se
     }
 
     if (use->valid)
-       ret = use;
+       *ret = use;
     else
        return -1;
 
index 538381b94077d1029b482f0e26e9ba77476f64ef..c7582c95d70d98ed7d5a4c0cfe5c8e64fa256f60 100644 (file)
@@ -278,7 +278,7 @@ afscp_CheckCallBack(const struct afscp_venusfid *fid, const struct afscp_server
     if (code != 0)
        return code;
 
-    code = afscp_FindCallBack(fid, server, cb);
+    code = afscp_FindCallBack(fid, server, &cb);
     if (code != 0)
        return code;