aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/v9fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/9p/v9fs.c')
-rw-r--r--fs/9p/v9fs.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index 5c1ccaf0416c..047c791427aa 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -206,12 +206,14 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
206 v9ses->uid = ~0; 206 v9ses->uid = ~0;
207 v9ses->dfltuid = V9FS_DEFUID; 207 v9ses->dfltuid = V9FS_DEFUID;
208 v9ses->dfltgid = V9FS_DEFGID; 208 v9ses->dfltgid = V9FS_DEFGID;
209 v9ses->options = kstrdup(data, GFP_KERNEL); 209 if (data) {
210 if (!v9ses->options) { 210 v9ses->options = kstrdup(data, GFP_KERNEL);
211 P9_DPRINTK(P9_DEBUG_ERROR, 211 if (!v9ses->options) {
212 P9_DPRINTK(P9_DEBUG_ERROR,
212 "failed to allocate copy of option string\n"); 213 "failed to allocate copy of option string\n");
213 retval = -ENOMEM; 214 retval = -ENOMEM;
214 goto error; 215 goto error;
216 }
215 } 217 }
216 218
217 rc = v9fs_parse_options(v9ses); 219 rc = v9fs_parse_options(v9ses);
@@ -260,7 +262,6 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
260 return fid; 262 return fid;
261 263
262error: 264error:
263 v9fs_session_close(v9ses);
264 return ERR_PTR(retval); 265 return ERR_PTR(retval);
265} 266}
266 267