From: Derrick Brashear Date: Sun, 13 Sep 2009 05:00:45 +0000 (-0400) Subject: cm fetchstore should dereference unset ops X-Git-Tag: openafs-devel-1_5_64~21 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=a747e934c40040061386d8ca591eba09b9745287 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 --- 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,