diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/9p/v9fs.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c index cf62b05e296a..6848788a13db 100644 --- a/fs/9p/v9fs.c +++ b/fs/9p/v9fs.c | |||
@@ -84,7 +84,7 @@ static const match_table_t tokens = { | |||
84 | 84 | ||
85 | static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts) | 85 | static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts) |
86 | { | 86 | { |
87 | char *options; | 87 | char *options, *tmp_options; |
88 | substring_t args[MAX_OPT_ARGS]; | 88 | substring_t args[MAX_OPT_ARGS]; |
89 | char *p; | 89 | char *p; |
90 | int option = 0; | 90 | int option = 0; |
@@ -102,9 +102,10 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts) | |||
102 | if (!opts) | 102 | if (!opts) |
103 | return 0; | 103 | return 0; |
104 | 104 | ||
105 | options = kstrdup(opts, GFP_KERNEL); | 105 | tmp_options = kstrdup(opts, GFP_KERNEL); |
106 | if (!options) | 106 | if (!tmp_options) |
107 | goto fail_option_alloc; | 107 | goto fail_option_alloc; |
108 | options = tmp_options; | ||
108 | 109 | ||
109 | while ((p = strsep(&options, ",")) != NULL) { | 110 | while ((p = strsep(&options, ",")) != NULL) { |
110 | int token; | 111 | int token; |
@@ -194,7 +195,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts) | |||
194 | continue; | 195 | continue; |
195 | } | 196 | } |
196 | } | 197 | } |
197 | kfree(options); | 198 | |
199 | kfree(tmp_options); | ||
198 | return ret; | 200 | return ret; |
199 | 201 | ||
200 | fail_option_alloc: | 202 | fail_option_alloc: |