lkml.org 
[lkml]   [2004]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: NFS thinko
On Fri, Apr 16, 2004 at 10:16:28PM +0100, Dave Jones wrote:
> Dereferencing 'exp' before the check for NULL.

Hmm. If we're referencing 'ek' to get at exp, 'ek' isn't an error,
so it shouldn't be passed into PTR_ERR().

> --- 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));
> }

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.035 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site