From: Dan Carpenter Date: Thu, 28 Oct 2010 06:05:57 +0000 (+0200) Subject: nfs: testing the wrong variable X-Git-Tag: v2.6.37-rc1~57^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8f0d97b41523fb85a2d230f6794121e5834f0cf9;p=karo-tx-linux.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 dec47ed8b6b9..4e2d9b6b1380 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;