linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] NFS: kmalloc() doesn't return an ERR_PTR()
@ 2012-05-14 19:45 Dan Carpenter
  2012-05-15 13:48 ` Boaz Harrosh
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2012-05-14 19:45 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs, kernel-janitors

Obviously we should check for NULL here instead of IS_ERR().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index ba3019f..233beea 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -644,14 +644,14 @@ static int nfs_idmap_legacy_upcall(struct key_construction *cons,
 
 	/* msg and im are freed in idmap_pipe_destroy_msg */
 	msg = kmalloc(sizeof(*msg), GFP_KERNEL);
-	if (IS_ERR(msg)) {
-		ret = PTR_ERR(msg);
+	if (!msg) {
+		ret = -ENOMEM;
 		goto out0;
 	}
 
 	im = kmalloc(sizeof(*im), GFP_KERNEL);
-	if (IS_ERR(im)) {
-		ret = PTR_ERR(im);
+	if (!im) {
+		ret = -ENOMEM;
 		goto out1;
 	}
 

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

end of thread, other threads:[~2012-05-16  0:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-14 19:45 [patch] NFS: kmalloc() doesn't return an ERR_PTR() Dan Carpenter
2012-05-15 13:48 ` Boaz Harrosh
2012-05-15 13:57   ` Dan Carpenter
2012-05-15 14:18     ` Boaz Harrosh
2012-05-15 15:27       ` Jim Rees
2012-05-15 16:06         ` Boaz Harrosh
2012-05-15 16:49       ` walter harms
2012-05-16  0:38         ` Peng Tao

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