From 3dc9fef67f6292692dba181a6d0fd0211bd0a607 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 5 Apr 2010 14:37:28 -0500 Subject: 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 Signed-off-by: Eric Van Hensbergen --- net/9p/client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'net/9p/client.c') diff --git a/net/9p/client.c b/net/9p/client.c index a037a29f3f0..20a33194d66 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) 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"); -- cgit v1.2.3-70-g09d2