NFS thinko

Dave Jones
2004-04-16T21:17:25Z

Dereferencing 'exp' before the check for NULL.

Dave

--- linux-2.6.5/include/linux/nfsd/export.h~ 2004-04-16 22:13:28.000000000 +0100
+++ linux-2.6.5/include/linux/nfsd/export.h 2004-04-16 22:14:21.000000000 +0100
@@ -118,13 +118,15 @@
if (ek && !IS_ERR(ek)) {
struct svc_export *exp = ek->ek_export;
int err;
+ if (!exp)
+ goto out;
cache_get(&exp->h);
expkey_put(&ek->h, &svc_expkey_cache);
- if (exp &&
- (err = cache_check(&svc_export_cache, &exp->h, reqp)))
+ if (err = cache_check(&svc_export_cache, &exp->h, reqp))
exp = ERR_PTR(err);
return exp;
} else
+out:
return ERR_PTR(PTR_ERR(ek));
}