diff options
author | Dan Carpenter <error27@gmail.com> | 2010-04-05 15:37:28 -0400 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2010-04-05 15:37:28 -0400 |
commit | 3dc9fef67f6292692dba181a6d0fd0211bd0a607 (patch) | |
tree | 643e6ecbcf8ffe58bdbd19ce2acde43643eeaf2b /net | |
parent | 85a770a8889035625466a4cfb1393cd7d2ffd165 (diff) |
9p: saving negative to unsigned char
Saving -EINVAL as unsigned char truncates the high bits and changes it
into 234 instead of -22. This breaks the test for "if (ret == -EINVAL)"
in parse_opts().
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/9p/client.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index a037a29f3f0e..20a33194d66e 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -71,9 +71,10 @@ inline int p9_is_proto_dotu(struct p9_client *clnt) | |||
71 | EXPORT_SYMBOL(p9_is_proto_dotu); | 71 | EXPORT_SYMBOL(p9_is_proto_dotu); |
72 | 72 | ||
73 | /* Interpret mount option for protocol version */ | 73 | /* Interpret mount option for protocol version */ |
74 | static unsigned char get_protocol_version(const substring_t *name) | 74 | static int get_protocol_version(const substring_t *name) |
75 | { | 75 | { |
76 | unsigned char version = -EINVAL; | 76 | int version = -EINVAL; |
77 | |||
77 | if (!strncmp("9p2000", name->from, name->to-name->from)) { | 78 | if (!strncmp("9p2000", name->from, name->to-name->from)) { |
78 | version = p9_proto_legacy; | 79 | version = p9_proto_legacy; |
79 | P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n"); | 80 | P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n"); |