diff options
-rw-r--r-- | include/net/9p/client.h | 1 | ||||
-rw-r--r-- | net/9p/client.c | 1 | ||||
-rw-r--r-- | net/9p/protocol.c | 24 |
3 files changed, 14 insertions, 12 deletions
diff --git a/include/net/9p/client.h b/include/net/9p/client.h index 9fe45b32ce4a..4012e07162e5 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h | |||
@@ -182,6 +182,7 @@ struct p9_fid { | |||
182 | struct list_head dlist; /* list of all fids attached to a dentry */ | 182 | struct list_head dlist; /* list of all fids attached to a dentry */ |
183 | }; | 183 | }; |
184 | 184 | ||
185 | int p9_client_version(struct p9_client *); | ||
185 | struct p9_client *p9_client_create(const char *dev_name, char *options); | 186 | struct p9_client *p9_client_create(const char *dev_name, char *options); |
186 | void p9_client_destroy(struct p9_client *clnt); | 187 | void p9_client_destroy(struct p9_client *clnt); |
187 | void p9_client_disconnect(struct p9_client *clnt); | 188 | void p9_client_disconnect(struct p9_client *clnt); |
diff --git a/net/9p/client.c b/net/9p/client.c index bbac2f72b4d2..67717f69412e 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -159,6 +159,7 @@ static struct p9_req_t *p9_tag_alloc(struct p9_client *c, u16 tag) | |||
159 | 159 | ||
160 | if (!c->reqs[row]) { | 160 | if (!c->reqs[row]) { |
161 | printk(KERN_ERR "Couldn't grow tag array\n"); | 161 | printk(KERN_ERR "Couldn't grow tag array\n"); |
162 | spin_unlock_irqrestore(&c->lock, flags); | ||
162 | return ERR_PTR(-ENOMEM); | 163 | return ERR_PTR(-ENOMEM); |
163 | } | 164 | } |
164 | for (col = 0; col < P9_ROW_MAXTAG; col++) { | 165 | for (col = 0; col < P9_ROW_MAXTAG; col++) { |
diff --git a/net/9p/protocol.c b/net/9p/protocol.c index 908e79faf48e..dcd7666824ba 100644 --- a/net/9p/protocol.c +++ b/net/9p/protocol.c | |||
@@ -186,7 +186,7 @@ p9pdu_vreadf(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap) | |||
186 | } | 186 | } |
187 | break; | 187 | break; |
188 | case 's':{ | 188 | case 's':{ |
189 | char **ptr = va_arg(ap, char **); | 189 | char **sptr = va_arg(ap, char **); |
190 | int16_t len; | 190 | int16_t len; |
191 | int size; | 191 | int size; |
192 | 192 | ||
@@ -196,17 +196,17 @@ p9pdu_vreadf(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap) | |||
196 | 196 | ||
197 | size = MAX(len, 0); | 197 | size = MAX(len, 0); |
198 | 198 | ||
199 | *ptr = kmalloc(size + 1, GFP_KERNEL); | 199 | *sptr = kmalloc(size + 1, GFP_KERNEL); |
200 | if (*ptr == NULL) { | 200 | if (*sptr == NULL) { |
201 | errcode = -EFAULT; | 201 | errcode = -EFAULT; |
202 | break; | 202 | break; |
203 | } | 203 | } |
204 | if (pdu_read(pdu, *ptr, size)) { | 204 | if (pdu_read(pdu, *sptr, size)) { |
205 | errcode = -EFAULT; | 205 | errcode = -EFAULT; |
206 | kfree(*ptr); | 206 | kfree(*sptr); |
207 | *ptr = NULL; | 207 | *sptr = NULL; |
208 | } else | 208 | } else |
209 | (*ptr)[size] = 0; | 209 | (*sptr)[size] = 0; |
210 | } | 210 | } |
211 | break; | 211 | break; |
212 | case 'Q':{ | 212 | case 'Q':{ |
@@ -380,13 +380,13 @@ p9pdu_vwritef(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap) | |||
380 | } | 380 | } |
381 | break; | 381 | break; |
382 | case 's':{ | 382 | case 's':{ |
383 | const char *ptr = va_arg(ap, const char *); | 383 | const char *sptr = va_arg(ap, const char *); |
384 | int16_t len = 0; | 384 | int16_t len = 0; |
385 | if (ptr) | 385 | if (sptr) |
386 | len = MIN(strlen(ptr), USHORT_MAX); | 386 | len = MIN(strlen(sptr), USHORT_MAX); |
387 | 387 | ||
388 | errcode = p9pdu_writef(pdu, optional, "w", len); | 388 | errcode = p9pdu_writef(pdu, optional, "w", len); |
389 | if (!errcode && pdu_write(pdu, ptr, len)) | 389 | if (!errcode && pdu_write(pdu, sptr, len)) |
390 | errcode = -EFAULT; | 390 | errcode = -EFAULT; |
391 | } | 391 | } |
392 | break; | 392 | break; |
@@ -426,7 +426,7 @@ p9pdu_vwritef(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap) | |||
426 | case 'U':{ | 426 | case 'U':{ |
427 | int32_t count = va_arg(ap, int32_t); | 427 | int32_t count = va_arg(ap, int32_t); |
428 | const char __user *udata = | 428 | const char __user *udata = |
429 | va_arg(ap, const void *); | 429 | va_arg(ap, const void __user *); |
430 | errcode = | 430 | errcode = |
431 | p9pdu_writef(pdu, optional, "d", count); | 431 | p9pdu_writef(pdu, optional, "d", count); |
432 | if (!errcode && pdu_write_u(pdu, udata, count)) | 432 | if (!errcode && pdu_write_u(pdu, udata, count)) |