aboutsummaryrefslogtreecommitdiffstats
path: root/net/9p/trans_rdma.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /net/9p/trans_rdma.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'net/9p/trans_rdma.c')
-rw-r--r--net/9p/trans_rdma.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c
index 65cb29db03f8..041101ab4aa5 100644
--- a/net/9p/trans_rdma.c
+++ b/net/9p/trans_rdma.c
@@ -40,6 +40,7 @@
40#include <linux/file.h> 40#include <linux/file.h>
41#include <linux/parser.h> 41#include <linux/parser.h>
42#include <linux/semaphore.h> 42#include <linux/semaphore.h>
43#include <linux/slab.h>
43#include <net/9p/9p.h> 44#include <net/9p/9p.h>
44#include <net/9p/client.h> 45#include <net/9p/client.h>
45#include <net/9p/transport.h> 46#include <net/9p/transport.h>
@@ -166,7 +167,7 @@ static int parse_opts(char *params, struct p9_rdma_opts *opts)
166 char *p; 167 char *p;
167 substring_t args[MAX_OPT_ARGS]; 168 substring_t args[MAX_OPT_ARGS];
168 int option; 169 int option;
169 char *options; 170 char *options, *tmp_options;
170 int ret; 171 int ret;
171 172
172 opts->port = P9_PORT; 173 opts->port = P9_PORT;
@@ -177,12 +178,13 @@ static int parse_opts(char *params, struct p9_rdma_opts *opts)
177 if (!params) 178 if (!params)
178 return 0; 179 return 0;
179 180
180 options = kstrdup(params, GFP_KERNEL); 181 tmp_options = kstrdup(params, GFP_KERNEL);
181 if (!options) { 182 if (!tmp_options) {
182 P9_DPRINTK(P9_DEBUG_ERROR, 183 P9_DPRINTK(P9_DEBUG_ERROR,
183 "failed to allocate copy of option string\n"); 184 "failed to allocate copy of option string\n");
184 return -ENOMEM; 185 return -ENOMEM;
185 } 186 }
187 options = tmp_options;
186 188
187 while ((p = strsep(&options, ",")) != NULL) { 189 while ((p = strsep(&options, ",")) != NULL) {
188 int token; 190 int token;
@@ -216,7 +218,7 @@ static int parse_opts(char *params, struct p9_rdma_opts *opts)
216 } 218 }
217 /* RQ must be at least as large as the SQ */ 219 /* RQ must be at least as large as the SQ */
218 opts->rq_depth = max(opts->rq_depth, opts->sq_depth); 220 opts->rq_depth = max(opts->rq_depth, opts->sq_depth);
219 kfree(options); 221 kfree(tmp_options);
220 return 0; 222 return 0;
221} 223}
222 224