diff options
author | Eric Van Hensbergen <ericvh@gmail.com> | 2008-10-22 19:54:47 -0400 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@opteron.(none)> | 2008-10-22 19:54:47 -0400 |
commit | e45c5405e12c7cef93940cb7a541ab459ec0096a (patch) | |
tree | 9855f49330da6658e505f6f51995aa216cddcdb5 /net | |
parent | fc79d4b104f0eb8c2a7242150eaf8756ced4c344 (diff) |
9p: fix sparse warnings
Several sparse warnings were introduced by patches accepted during the merge
window which weren't caught. This patch fixes those warnings.
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/9p/client.c | 1 | ||||
-rw-r--r-- | net/9p/protocol.c | 24 |
2 files changed, 13 insertions, 12 deletions
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)) |