diff options
Diffstat (limited to 'net/9p/protocol.c')
-rw-r--r-- | net/9p/protocol.c | 24 |
1 files changed, 12 insertions, 12 deletions
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)) |