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>
This commit is contained in:
Eric Van Hensbergen 2008-10-22 18:54:47 -05:00 committed by Eric Van Hensbergen
parent fc79d4b104
commit e45c5405e1
3 changed files with 14 additions and 12 deletions

View File

@ -182,6 +182,7 @@ struct p9_fid {
struct list_head dlist; /* list of all fids attached to a dentry */ struct list_head dlist; /* list of all fids attached to a dentry */
}; };
int p9_client_version(struct p9_client *);
struct p9_client *p9_client_create(const char *dev_name, char *options); struct p9_client *p9_client_create(const char *dev_name, char *options);
void p9_client_destroy(struct p9_client *clnt); void p9_client_destroy(struct p9_client *clnt);
void p9_client_disconnect(struct p9_client *clnt); void p9_client_disconnect(struct p9_client *clnt);

View File

@ -159,6 +159,7 @@ static struct p9_req_t *p9_tag_alloc(struct p9_client *c, u16 tag)
if (!c->reqs[row]) { if (!c->reqs[row]) {
printk(KERN_ERR "Couldn't grow tag array\n"); printk(KERN_ERR "Couldn't grow tag array\n");
spin_unlock_irqrestore(&c->lock, flags);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
for (col = 0; col < P9_ROW_MAXTAG; col++) { for (col = 0; col < P9_ROW_MAXTAG; col++) {

View File

@ -186,7 +186,7 @@ p9pdu_vreadf(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap)
} }
break; break;
case 's':{ case 's':{
char **ptr = va_arg(ap, char **); char **sptr = va_arg(ap, char **);
int16_t len; int16_t len;
int size; int size;
@ -196,17 +196,17 @@ p9pdu_vreadf(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap)
size = MAX(len, 0); size = MAX(len, 0);
*ptr = kmalloc(size + 1, GFP_KERNEL); *sptr = kmalloc(size + 1, GFP_KERNEL);
if (*ptr == NULL) { if (*sptr == NULL) {
errcode = -EFAULT; errcode = -EFAULT;
break; break;
} }
if (pdu_read(pdu, *ptr, size)) { if (pdu_read(pdu, *sptr, size)) {
errcode = -EFAULT; errcode = -EFAULT;
kfree(*ptr); kfree(*sptr);
*ptr = NULL; *sptr = NULL;
} else } else
(*ptr)[size] = 0; (*sptr)[size] = 0;
} }
break; break;
case 'Q':{ case 'Q':{
@ -380,13 +380,13 @@ p9pdu_vwritef(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap)
} }
break; break;
case 's':{ case 's':{
const char *ptr = va_arg(ap, const char *); const char *sptr = va_arg(ap, const char *);
int16_t len = 0; int16_t len = 0;
if (ptr) if (sptr)
len = MIN(strlen(ptr), USHORT_MAX); len = MIN(strlen(sptr), USHORT_MAX);
errcode = p9pdu_writef(pdu, optional, "w", len); errcode = p9pdu_writef(pdu, optional, "w", len);
if (!errcode && pdu_write(pdu, ptr, len)) if (!errcode && pdu_write(pdu, sptr, len))
errcode = -EFAULT; errcode = -EFAULT;
} }
break; break;
@ -426,7 +426,7 @@ p9pdu_vwritef(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap)
case 'U':{ case 'U':{
int32_t count = va_arg(ap, int32_t); int32_t count = va_arg(ap, int32_t);
const char __user *udata = const char __user *udata =
va_arg(ap, const void *); va_arg(ap, const void __user *);
errcode = errcode =
p9pdu_writef(pdu, optional, "d", count); p9pdu_writef(pdu, optional, "d", count);
if (!errcode && pdu_write_u(pdu, udata, count)) if (!errcode && pdu_write_u(pdu, udata, count))