linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] nfs: testing the wrong variable
@ 2010-10-28  6:05 Dan Carpenter
  2010-10-28 18:18 ` Trond Myklebust
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-10-28  6:05 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs, kernel-janitors

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;

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

end of thread, other threads:[~2010-10-28 18:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-28  6:05 [patch] nfs: testing the wrong variable Dan Carpenter
2010-10-28 18:18 ` Trond Myklebust

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).