From: Dan Carpenter Date: Thu, 28 Oct 2010 06:05:57 +0000 (+0200) Subject: nfs: testing the wrong variable X-Git-Tag: v3.0~2962^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f0d97b41523fb85a2d230f6794121e5834f0cf9;p=platform%2Fkernel%2Flinux-amlogic.git nfs: testing the wrong variable 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 Signed-off-by: Trond Myklebust --- 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;