afs_fetchstore: avoid use of uninitialized variable
[openafs.git] / src / afs / afs_fetchstore.c
index bf019c4..8db6697 100644 (file)
@@ -388,9 +388,9 @@ rxfs_storeInit(struct vcache *avc, struct afs_conn *tc,
 #ifdef AFS_64BIT_CLIENT
        if (!afs_serverHasNo64Bit(tc))
            code = StartRXAFS_StoreData64(
-                               v->call, (struct AFSFid*)&avc->f.fid.Fid,
-                               &v->InStatus, base, bytes, length);
-       else
+               v->call, (struct AFSFid*)&avc->f.fid.Fid,
+               &v->InStatus, base, bytes, length);
+       else {
            if (length > 0xFFFFFFFF)
                code = EFBIG;
            else {
@@ -399,6 +399,8 @@ rxfs_storeInit(struct vcache *avc, struct afs_conn *tc,
                                        (struct AFSFid *) &avc->f.fid.Fid,
                                         &v->InStatus, t1, t2, t3);
            }
+           v->hasNo64bit = 1;
+       }
 #else /* AFS_64BIT_CLIENT */
        code = StartRXAFS_StoreData(v->call, (struct AFSFid *)&avc->f.fid.Fid,
                                    &v->InStatus, base, bytes, length);
@@ -463,6 +465,7 @@ afs_CacheStoreDCaches(struct vcache *avc, struct dcache **dclist,
 {
     int *shouldwake = NULL;
     unsigned int i;
+    int stored = 0;
     afs_int32 code = 0;
     afs_size_t bytesXferred;
 
@@ -474,7 +477,6 @@ afs_CacheStoreDCaches(struct vcache *avc, struct dcache **dclist,
     osi_Assert(nchunks != 0);
 
     for (i = 0; i < nchunks && !code; i++) {
-       int stored = 0;
        struct dcache *tdc = dclist[i];
        afs_int32 size;
 
@@ -970,8 +972,11 @@ rxfs_fetchInit(struct afs_conn *tc, struct rx_connection *rxconn,
                RX_AFS_GLOCK();
            }
            afs_serverSetNo64Bit(tc);
+           v->hasNo64bit = 1;
        }
-       if (!code) {
+       if (code) {
+           goto err;
+       } else {
            RX_AFS_GUNLOCK();
            bytes = rx_Read(v->call, (char *)&length, sizeof(afs_int32));
            RX_AFS_GLOCK();
@@ -1029,6 +1034,7 @@ rxfs_fetchInit(struct afs_conn *tc, struct rx_connection *rxconn,
        code = EIO;
     }
 
+err:
     if (!code && code1)
        code = code1;
 
@@ -1114,9 +1120,7 @@ afs_CacheFetchProc(struct afs_conn *tc, struct rx_connection *rxconn,
     osi_GetuTime(&xferStartTime);
 #endif /* AFS_NOSTATS */
 
-    if (adc) {
-       adc->validPos = base;
-    }
+    adc->validPos = base;
 
     if ( !code ) do {
        if (avc->f.states & CForeign) {