aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-05-14 15:45:28 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-05-14 20:44:01 -0400
commit5abc03cd919535c61b813f2319cb38326a41e810 (patch)
tree22a180bdca008b9f7a1951c01f4732d4433e6ddd /fs/nfs
parent36be50515fe2aef61533b516fa2576a2c7fe7664 (diff)
NFS: kmalloc() doesn't return an ERR_PTR()
Obviously we should check for NULL here instead of IS_ERR(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable@vger.kernel.org [3.4] Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/idmap.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index ba3019f5934c..3e8edbe71ec6 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -640,20 +640,16 @@ static int nfs_idmap_legacy_upcall(struct key_construction *cons,
640 struct idmap_msg *im; 640 struct idmap_msg *im;
641 struct idmap *idmap = (struct idmap *)aux; 641 struct idmap *idmap = (struct idmap *)aux;
642 struct key *key = cons->key; 642 struct key *key = cons->key;
643 int ret; 643 int ret = -ENOMEM;
644 644
645 /* msg and im are freed in idmap_pipe_destroy_msg */ 645 /* msg and im are freed in idmap_pipe_destroy_msg */
646 msg = kmalloc(sizeof(*msg), GFP_KERNEL); 646 msg = kmalloc(sizeof(*msg), GFP_KERNEL);
647 if (IS_ERR(msg)) { 647 if (!msg)
648 ret = PTR_ERR(msg);
649 goto out0; 648 goto out0;
650 }
651 649
652 im = kmalloc(sizeof(*im), GFP_KERNEL); 650 im = kmalloc(sizeof(*im), GFP_KERNEL);
653 if (IS_ERR(im)) { 651 if (!im)
654 ret = PTR_ERR(im);
655 goto out1; 652 goto out1;
656 }
657 653
658 ret = nfs_idmap_prepare_message(key->description, im, msg); 654 ret = nfs_idmap_prepare_message(key->description, im, msg);
659 if (ret < 0) 655 if (ret < 0)