diff --git a/src/WINNT/afsd/cm_buf.c b/src/WINNT/afsd/cm_buf.c index 483c0c2f17..73d64f8e5f 100644 --- a/src/WINNT/afsd/cm_buf.c +++ b/src/WINNT/afsd/cm_buf.c @@ -888,7 +888,7 @@ void buf_Recycle(cm_buf_t *bp) i = BUF_HASH(&bp->fid, &bp->offset); lbpp = &(cm_data.buf_scacheHashTablepp[i]); - for(tbp = *lbpp; tbp; lbpp = &tbp->hashp, tbp = *lbpp) { + for(tbp = *lbpp; tbp; lbpp = &tbp->hashp, tbp = tbp->hashp) { if (tbp == bp) break; } diff --git a/src/WINNT/afsd/cm_scache.c b/src/WINNT/afsd/cm_scache.c index db24b4fe34..687b0cdfe4 100644 --- a/src/WINNT/afsd/cm_scache.c +++ b/src/WINNT/afsd/cm_scache.c @@ -1646,11 +1646,14 @@ void cm_MergeStatus(cm_scache_t *dscp, j = BUF_HASH(&bp->fid, &bp->offset); lbpp = &(cm_data.buf_scacheHashTablepp[j]); - for(tbp = *lbpp; tbp; lbpp = &tbp->hashp, tbp = *lbpp) { + for(tbp = *lbpp; tbp; lbpp = &tbp->hashp, tbp = tbp->hashp) { if (tbp == bp) break; } + /* we better find it */ + osi_assertx(tbp != NULL, "cm_MergeStatus: buf_scacheHashTablepp table screwup"); + *lbpp = bp->hashp; /* hash out */ bp->hashp = NULL;