linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: Dan Carpenter <error27@gmail.com>
Cc: linux-nfs@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] nfs: testing the wrong variable
Date: Thu, 28 Oct 2010 14:18:01 -0400	[thread overview]
Message-ID: <1288289881.14221.14.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <20101028060557.GY6062@bicker>

On Thu, 2010-10-28 at 08:05 +0200, Dan Carpenter wrote:
> The intent was to test "*desc" for allocation failures, but it tests
> "desc" which is always a valid pointer here.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
> index dec47ed..4e2d9b6 100644
> --- a/fs/nfs/idmap.c
> +++ b/fs/nfs/idmap.c
> @@ -123,7 +123,7 @@ static ssize_t nfs_idmap_get_desc(const char *name, size_t namelen,
>  	size_t desclen = typelen + namelen + 2;
>  
>  	*desc = kmalloc(desclen, GFP_KERNEL);
> -	if (!desc)
> +	if (!*desc)
>  		return -ENOMEM;
>  
>  	cp = *desc;

Thanks! Applied!

Trond

      reply	other threads:[~2010-10-28 18:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-28  6:05 [patch] nfs: testing the wrong variable Dan Carpenter
2010-10-28 18:18 ` Trond Myklebust [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1288289881.14221.14.camel@heimdal.trondhjem.org \
    --to=trond.myklebust@netapp.com \
    --cc=error27@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).