9p: saving negative to unsigned char
authorDan Carpenter <error27@gmail.com>
Mon, 5 Apr 2010 19:37:28 +0000 (14:37 -0500)
committerEric Van Hensbergen <ericvh@gmail.com>
Mon, 5 Apr 2010 19:37:28 +0000 (14:37 -0500)
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>
net/9p/client.c

index a037a29..20a3319 100644 (file)
@@ -71,9 +71,10 @@ inline int p9_is_proto_dotu(struct p9_client *clnt)
 EXPORT_SYMBOL(p9_is_proto_dotu);
 
 /* Interpret mount option for protocol version */
 EXPORT_SYMBOL(p9_is_proto_dotu);
 
 /* Interpret mount option for protocol version */
-static unsigned char get_protocol_version(const substring_t *name)
+static int get_protocol_version(const substring_t *name)
 {
 {
-       unsigned char version = -EINVAL;
+       int version = -EINVAL;
+
        if (!strncmp("9p2000", name->from, name->to-name->from)) {
                version = p9_proto_legacy;
                P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n");
        if (!strncmp("9p2000", name->from, name->to-name->from)) {
                version = p9_proto_legacy;
                P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n");