All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] nfsd: potential ERR_PTR dereference on exp_export() error
@ 2010-04-22  9:30 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2010-04-22  9:30 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Neil Brown, Trond Myklebust, linux-nfs, kernel-janitors

We "goto finish" from several places where "exp" is an ERR_PTR.  Also I 
changed the check for "fsid_key" so that it was consistent with the check
I added.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 872a5ef..bfe6f3f 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -1071,9 +1071,9 @@ exp_export(struct nfsctl_export *nxp)
 		err = 0;
 finish:
 	kfree(new.ex_pathname);
-	if (exp)
+	if (!IS_ERR_OR_NULL(exp))
 		exp_put(exp);
-	if (fsid_key && !IS_ERR(fsid_key))
+	if (!IS_ERR_OR_NULL(fsid_key))
 		cache_put(&fsid_key->h, &svc_expkey_cache);
 	path_put(&path);
 out_put_clp:

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [patch] nfsd: potential ERR_PTR dereference on exp_export() error paths.
@ 2010-04-22  9:30 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2010-04-22  9:30 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Neil Brown, Trond Myklebust, linux-nfs, kernel-janitors

We "goto finish" from several places where "exp" is an ERR_PTR.  Also I 
changed the check for "fsid_key" so that it was consistent with the check
I added.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 872a5ef..bfe6f3f 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -1071,9 +1071,9 @@ exp_export(struct nfsctl_export *nxp)
 		err = 0;
 finish:
 	kfree(new.ex_pathname);
-	if (exp)
+	if (!IS_ERR_OR_NULL(exp))
 		exp_put(exp);
-	if (fsid_key && !IS_ERR(fsid_key))
+	if (!IS_ERR_OR_NULL(fsid_key))
 		cache_put(&fsid_key->h, &svc_expkey_cache);
 	path_put(&path);
 out_put_clp:

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch] nfsd: potential ERR_PTR dereference on exp_export()
  2010-04-22  9:30 ` [patch] nfsd: potential ERR_PTR dereference on exp_export() error paths Dan Carpenter
@ 2010-04-22 15:59   ` J. Bruce Fields
  -1 siblings, 0 replies; 4+ messages in thread
From: J. Bruce Fields @ 2010-04-22 15:59 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Neil Brown, Trond Myklebust, linux-nfs, kernel-janitors

On Thu, Apr 22, 2010 at 11:30:59AM +0200, Dan Carpenter wrote:
> We "goto finish" from several places where "exp" is an ERR_PTR.  Also I 
> changed the check for "fsid_key" so that it was consistent with the check
> I added.

OK, thanks; applied.

--b.

> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> index 872a5ef..bfe6f3f 100644
> --- a/fs/nfsd/export.c
> +++ b/fs/nfsd/export.c
> @@ -1071,9 +1071,9 @@ exp_export(struct nfsctl_export *nxp)
>  		err = 0;
>  finish:
>  	kfree(new.ex_pathname);
> -	if (exp)
> +	if (!IS_ERR_OR_NULL(exp))
>  		exp_put(exp);
> -	if (fsid_key && !IS_ERR(fsid_key))
> +	if (!IS_ERR_OR_NULL(fsid_key))
>  		cache_put(&fsid_key->h, &svc_expkey_cache);
>  	path_put(&path);
>  out_put_clp:

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] nfsd: potential ERR_PTR dereference on exp_export() error paths.
@ 2010-04-22 15:59   ` J. Bruce Fields
  0 siblings, 0 replies; 4+ messages in thread
From: J. Bruce Fields @ 2010-04-22 15:59 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Neil Brown, Trond Myklebust, linux-nfs, kernel-janitors

On Thu, Apr 22, 2010 at 11:30:59AM +0200, Dan Carpenter wrote:
> We "goto finish" from several places where "exp" is an ERR_PTR.  Also I 
> changed the check for "fsid_key" so that it was consistent with the check
> I added.

OK, thanks; applied.

--b.

> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> index 872a5ef..bfe6f3f 100644
> --- a/fs/nfsd/export.c
> +++ b/fs/nfsd/export.c
> @@ -1071,9 +1071,9 @@ exp_export(struct nfsctl_export *nxp)
>  		err = 0;
>  finish:
>  	kfree(new.ex_pathname);
> -	if (exp)
> +	if (!IS_ERR_OR_NULL(exp))
>  		exp_put(exp);
> -	if (fsid_key && !IS_ERR(fsid_key))
> +	if (!IS_ERR_OR_NULL(fsid_key))
>  		cache_put(&fsid_key->h, &svc_expkey_cache);
>  	path_put(&path);
>  out_put_clp:

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-22 15:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-22  9:30 [patch] nfsd: potential ERR_PTR dereference on exp_export() error Dan Carpenter
2010-04-22  9:30 ` [patch] nfsd: potential ERR_PTR dereference on exp_export() error paths Dan Carpenter
2010-04-22 15:59 ` [patch] nfsd: potential ERR_PTR dereference on exp_export() J. Bruce Fields
2010-04-22 15:59   ` [patch] nfsd: potential ERR_PTR dereference on exp_export() error paths J. Bruce Fields

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.