aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/9p/v9fs.c6
-rw-r--r--fs/9p/vfs_super.c3
-rw-r--r--net/9p/mod.c4
-rw-r--r--net/9p/trans_fd.c3
4 files changed, 11 insertions, 5 deletions
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index 756f7e9beb2e..fbb12dadba83 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -82,7 +82,7 @@ static match_table_t tokens = {
82 82
83static void v9fs_parse_options(struct v9fs_session_info *v9ses) 83static void v9fs_parse_options(struct v9fs_session_info *v9ses)
84{ 84{
85 char *options = v9ses->options; 85 char *options;
86 substring_t args[MAX_OPT_ARGS]; 86 substring_t args[MAX_OPT_ARGS];
87 char *p; 87 char *p;
88 int option; 88 int option;
@@ -96,9 +96,10 @@ static void v9fs_parse_options(struct v9fs_session_info *v9ses)
96 v9ses->cache = 0; 96 v9ses->cache = 0;
97 v9ses->trans = v9fs_default_trans(); 97 v9ses->trans = v9fs_default_trans();
98 98
99 if (!options) 99 if (!v9ses->options)
100 return; 100 return;
101 101
102 options = kstrdup(v9ses->options, GFP_KERNEL);
102 while ((p = strsep(&options, ",")) != NULL) { 103 while ((p = strsep(&options, ",")) != NULL) {
103 int token; 104 int token;
104 if (!*p) 105 if (!*p)
@@ -169,6 +170,7 @@ static void v9fs_parse_options(struct v9fs_session_info *v9ses)
169 continue; 170 continue;
170 } 171 }
171 } 172 }
173 kfree(options);
172} 174}
173 175
174/** 176/**
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index bb0cef9a6b8a..678c02f1ae23 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -119,6 +119,7 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
119 119
120 P9_DPRINTK(P9_DEBUG_VFS, " \n"); 120 P9_DPRINTK(P9_DEBUG_VFS, " \n");
121 121
122 st = NULL;
122 v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL); 123 v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL);
123 if (!v9ses) 124 if (!v9ses)
124 return -ENOMEM; 125 return -ENOMEM;
@@ -164,10 +165,12 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
164 root->d_inode->i_ino = v9fs_qid2ino(&st->qid); 165 root->d_inode->i_ino = v9fs_qid2ino(&st->qid);
165 v9fs_stat2inode(st, root->d_inode, sb); 166 v9fs_stat2inode(st, root->d_inode, sb);
166 v9fs_fid_add(root, fid); 167 v9fs_fid_add(root, fid);
168 kfree(st);
167 169
168 return simple_set_mnt(mnt, sb); 170 return simple_set_mnt(mnt, sb);
169 171
170error: 172error:
173 kfree(st);
171 if (fid) 174 if (fid)
172 p9_client_clunk(fid); 175 p9_client_clunk(fid);
173 176
diff --git a/net/9p/mod.c b/net/9p/mod.c
index 41d70f47375d..8f9763a9dc12 100644
--- a/net/9p/mod.c
+++ b/net/9p/mod.c
@@ -76,9 +76,9 @@ struct p9_trans_module *v9fs_match_trans(const substring_t *name)
76 list_for_each(p, &v9fs_trans_list) { 76 list_for_each(p, &v9fs_trans_list) {
77 t = list_entry(p, struct p9_trans_module, list); 77 t = list_entry(p, struct p9_trans_module, list);
78 if (strncmp(t->name, name->from, name->to-name->from) == 0) 78 if (strncmp(t->name, name->from, name->to-name->from) == 0)
79 break; 79 return t;
80 } 80 }
81 return t; 81 return NULL;
82} 82}
83EXPORT_SYMBOL(v9fs_match_trans); 83EXPORT_SYMBOL(v9fs_match_trans);
84 84
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index 30269a4ff22a..62332ed9da4a 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -62,13 +62,14 @@ struct p9_trans_fd {
62 62
63enum { 63enum {
64 /* Options that take integer arguments */ 64 /* Options that take integer arguments */
65 Opt_port, Opt_rfdno, Opt_wfdno, 65 Opt_port, Opt_rfdno, Opt_wfdno, Opt_err,
66}; 66};
67 67
68static match_table_t tokens = { 68static match_table_t tokens = {
69 {Opt_port, "port=%u"}, 69 {Opt_port, "port=%u"},
70 {Opt_rfdno, "rfdno=%u"}, 70 {Opt_rfdno, "rfdno=%u"},
71 {Opt_wfdno, "wfdno=%u"}, 71 {Opt_wfdno, "wfdno=%u"},
72 {Opt_err, NULL},
72}; 73};
73 74
74/** 75/**