aboutsummaryrefslogtreecommitdiff
path: root/fs/nfs
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-05-14 22:45:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-10 00:36:09 +0900
commitc780682d113ef97164359897f4463585b4c27524 (patch)
tree3a8e1278191eb864849c8fbce606e7ca2d830af4 /fs/nfs
parent2b06dfb55b78e57734a696324ce7d593b1c084be (diff)
NFS: kmalloc() doesn't return an ERR_PTR()
commit 5abc03cd919535c61b813f2319cb38326a41e810 upstream. Obviously we should check for NULL here instead of IS_ERR(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 ba3019f5934..3e8edbe71ec 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,
struct idmap_msg *im;
struct idmap *idmap = (struct idmap *)aux;
struct key *key = cons->key;
- int ret;
+ int ret = -ENOMEM;
/* 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)
goto out0;
- }
im = kmalloc(sizeof(*im), GFP_KERNEL);
- if (IS_ERR(im)) {
- ret = PTR_ERR(im);
+ if (!im)
goto out1;
- }
ret = nfs_idmap_prepare_message(key->description, im, msg);
if (ret < 0)