Skip to content

Commit

Permalink
nfs: testing the wrong variable
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Dan Carpenter authored and Trond Myklebust committed Oct 28, 2010
1 parent 015f021 commit 8f0d97b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8f0d97b

Please sign in to comment.