diff options
Diffstat (limited to 'fs/nfs/idmap.c')
-rw-r--r-- | fs/nfs/idmap.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c index d05148ec9414..231c20ffc0ff 100644 --- a/fs/nfs/idmap.c +++ b/fs/nfs/idmap.c | |||
@@ -108,15 +108,17 @@ static struct rpc_pipe_ops idmap_upcall_ops = { | |||
108 | .destroy_msg = idmap_pipe_destroy_msg, | 108 | .destroy_msg = idmap_pipe_destroy_msg, |
109 | }; | 109 | }; |
110 | 110 | ||
111 | void | 111 | int |
112 | nfs_idmap_new(struct nfs_client *clp) | 112 | nfs_idmap_new(struct nfs_client *clp) |
113 | { | 113 | { |
114 | struct idmap *idmap; | 114 | struct idmap *idmap; |
115 | int error; | ||
115 | 116 | ||
116 | if (clp->cl_idmap != NULL) | 117 | if (clp->cl_idmap != NULL) |
117 | return; | 118 | return 0; |
119 | |||
118 | if ((idmap = kzalloc(sizeof(*idmap), GFP_KERNEL)) == NULL) | 120 | if ((idmap = kzalloc(sizeof(*idmap), GFP_KERNEL)) == NULL) |
119 | return; | 121 | return -ENOMEM; |
120 | 122 | ||
121 | snprintf(idmap->idmap_path, sizeof(idmap->idmap_path), | 123 | snprintf(idmap->idmap_path, sizeof(idmap->idmap_path), |
122 | "%s/idmap", clp->cl_rpcclient->cl_pathname); | 124 | "%s/idmap", clp->cl_rpcclient->cl_pathname); |
@@ -124,8 +126,9 @@ nfs_idmap_new(struct nfs_client *clp) | |||
124 | idmap->idmap_dentry = rpc_mkpipe(idmap->idmap_path, | 126 | idmap->idmap_dentry = rpc_mkpipe(idmap->idmap_path, |
125 | idmap, &idmap_upcall_ops, 0); | 127 | idmap, &idmap_upcall_ops, 0); |
126 | if (IS_ERR(idmap->idmap_dentry)) { | 128 | if (IS_ERR(idmap->idmap_dentry)) { |
129 | error = PTR_ERR(idmap->idmap_dentry); | ||
127 | kfree(idmap); | 130 | kfree(idmap); |
128 | return; | 131 | return error; |
129 | } | 132 | } |
130 | 133 | ||
131 | mutex_init(&idmap->idmap_lock); | 134 | mutex_init(&idmap->idmap_lock); |
@@ -135,6 +138,7 @@ nfs_idmap_new(struct nfs_client *clp) | |||
135 | idmap->idmap_group_hash.h_type = IDMAP_TYPE_GROUP; | 138 | idmap->idmap_group_hash.h_type = IDMAP_TYPE_GROUP; |
136 | 139 | ||
137 | clp->cl_idmap = idmap; | 140 | clp->cl_idmap = idmap; |
141 | return 0; | ||
138 | } | 142 | } |
139 | 143 | ||
140 | void | 144 | void |