All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] NFS: kmalloc() doesn't return an ERR_PTR()
@ 2012-05-14 19:45 ` Dan Carpenter
  0 siblings, 0 replies; 16+ 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] 16+ messages in thread

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

Thread overview: 16+ 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-14 19:45 ` Dan Carpenter
2012-05-15 13:48 ` Boaz Harrosh
2012-05-15 13:48   ` Boaz Harrosh
2012-05-15 13:57   ` Dan Carpenter
2012-05-15 13:57     ` Dan Carpenter
2012-05-15 14:18     ` Boaz Harrosh
2012-05-15 14:18       ` Boaz Harrosh
2012-05-15 15:27       ` Jim Rees
2012-05-15 15:27         ` Jim Rees
2012-05-15 16:06         ` Boaz Harrosh
2012-05-15 16:06           ` Boaz Harrosh
2012-05-15 16:49       ` walter harms
2012-05-15 16:49         ` walter harms
2012-05-16  0:38         ` Peng Tao
2012-05-16  0:38           ` Peng Tao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.