afs: Avoid panics on failed return from afs_CFileOpen
[openafs.git] / src / afs / afs_fetchstore.c
index 06325b9..e2b3f2b 100644 (file)
@@ -270,7 +270,9 @@ afs_GenericStoreProc(struct storeOps *ops, void *rock,
     size = tdc->f.chunkBytes;
 
     tfile = afs_CFileOpen(&tdc->f.inode);
-    osi_Assert(tfile);
+    if (!tfile) {
+       return EIO;
+    }
 
     while ( size > 0 ) {
        code = (*ops->prepare)(rock, size, &tlen);