From a747e934c40040061386d8ca591eba09b9745287 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Sun, 13 Sep 2009 01:00:45 -0400 Subject: [PATCH] cm fetchstore should dereference unset ops if rxfs_fetchInit fails, ops will not be set; calling the destroy op unconditionally thus leads to a panic. Reviewed-on: http://gerrit.openafs.org/452 Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- src/afs/afs_fetchstore.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/afs/afs_fetchstore.c b/src/afs/afs_fetchstore.c index cd2a4b5..6f2f354 100644 --- a/src/afs/afs_fetchstore.c +++ b/src/afs/afs_fetchstore.c @@ -529,7 +529,8 @@ afs_CacheStoreDCaches(struct vcache *avc, struct dcache **dclist, } XSTATS_END_TIME; } - code = (*ops->destroy)(&rock, code); + if (ops) + code = (*ops->destroy)(&rock, code); return code; } @@ -1129,7 +1130,8 @@ afs_CacheFetchProc(struct afs_conn *tc, struct osi_file *fP, afs_size_t base, } while (moredata); if (!code) code = (*ops->close)(rock, avc, adc, tsmall); - (*ops->destroy)(&rock, code); + if (ops) + (*ops->destroy)(&rock, code); #ifndef AFS_NOSTATS FillStoreStats(code, AFS_STATS_FS_XFERIDX_FETCHDATA, &xferStartTime, -- 1.9.4