Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180380
b: refs/heads/master
c: d8c8a9e
h: refs/heads/master
v: v3
  • Loading branch information
Eric Van Hensbergen committed Feb 8, 2010
1 parent 7bedfb9 commit 4f5f452
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a4439c406c21b1e900ed497cec1a79d05b38c07
refs/heads/master: d8c8a9e36560e9ff4c99279d64ce5dd0e1a33fa6
10 changes: 6 additions & 4 deletions trunk/fs/9p/v9fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static const match_table_t tokens = {

static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
{
char *options;
char *options, *tmp_options;
substring_t args[MAX_OPT_ARGS];
char *p;
int option = 0;
Expand All @@ -102,9 +102,10 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
if (!opts)
return 0;

options = kstrdup(opts, GFP_KERNEL);
if (!options)
tmp_options = kstrdup(opts, GFP_KERNEL);
if (!tmp_options)
goto fail_option_alloc;
options = tmp_options;

while ((p = strsep(&options, ",")) != NULL) {
int token;
Expand Down Expand Up @@ -194,7 +195,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
continue;
}
}
kfree(options);

kfree(tmp_options);
return ret;

fail_option_alloc:
Expand Down
9 changes: 5 additions & 4 deletions trunk/net/9p/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...);

static int parse_opts(char *opts, struct p9_client *clnt)
{
char *options;
char *options, *tmp_options;
char *p;
substring_t args[MAX_OPT_ARGS];
int option;
Expand All @@ -81,12 +81,13 @@ static int parse_opts(char *opts, struct p9_client *clnt)
if (!opts)
return 0;

options = kstrdup(opts, GFP_KERNEL);
if (!options) {
tmp_options = kstrdup(opts, GFP_KERNEL);
if (!tmp_options) {
P9_DPRINTK(P9_DEBUG_ERROR,
"failed to allocate copy of option string\n");
return -ENOMEM;
}
options = tmp_options;

while ((p = strsep(&options, ",")) != NULL) {
int token;
Expand Down Expand Up @@ -125,7 +126,7 @@ static int parse_opts(char *opts, struct p9_client *clnt)
}

free_and_return:
kfree(options);
kfree(tmp_options);
return ret;
}

Expand Down
10 changes: 6 additions & 4 deletions trunk/net/9p/trans_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ static int parse_opts(char *params, struct p9_fd_opts *opts)
char *p;
substring_t args[MAX_OPT_ARGS];
int option;
char *options;
char *options, *tmp_options;
int ret;

opts->port = P9_PORT;
Expand All @@ -724,12 +724,13 @@ static int parse_opts(char *params, struct p9_fd_opts *opts)
if (!params)
return 0;

options = kstrdup(params, GFP_KERNEL);
if (!options) {
tmp_options = kstrdup(params, GFP_KERNEL);
if (!tmp_options) {
P9_DPRINTK(P9_DEBUG_ERROR,
"failed to allocate copy of option string\n");
return -ENOMEM;
}
options = tmp_options;

while ((p = strsep(&options, ",")) != NULL) {
int token;
Expand Down Expand Up @@ -760,7 +761,8 @@ static int parse_opts(char *params, struct p9_fd_opts *opts)
continue;
}
}
kfree(options);

kfree(tmp_options);
return 0;
}

Expand Down
9 changes: 5 additions & 4 deletions trunk/net/9p/trans_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static int parse_opts(char *params, struct p9_rdma_opts *opts)
char *p;
substring_t args[MAX_OPT_ARGS];
int option;
char *options;
char *options, *tmp_options;
int ret;

opts->port = P9_PORT;
Expand All @@ -177,12 +177,13 @@ static int parse_opts(char *params, struct p9_rdma_opts *opts)
if (!params)
return 0;

options = kstrdup(params, GFP_KERNEL);
if (!options) {
tmp_options = kstrdup(params, GFP_KERNEL);
if (!tmp_options) {
P9_DPRINTK(P9_DEBUG_ERROR,
"failed to allocate copy of option string\n");
return -ENOMEM;
}
options = tmp_options;

while ((p = strsep(&options, ",")) != NULL) {
int token;
Expand Down Expand Up @@ -216,7 +217,7 @@ static int parse_opts(char *params, struct p9_rdma_opts *opts)
}
/* RQ must be at least as large as the SQ */
opts->rq_depth = max(opts->rq_depth, opts->sq_depth);
kfree(options);
kfree(tmp_options);
return 0;
}

Expand Down

0 comments on commit 4f5f452

Please sign in to comment.