提交 3dc9fef6 编写于 作者: D Dan Carpenter 提交者: Eric Van Hensbergen

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: NDan Carpenter <error27@gmail.com>
Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
上级 85a770a8
...@@ -71,9 +71,10 @@ inline int p9_is_proto_dotu(struct p9_client *clnt) ...@@ -71,9 +71,10 @@ inline int p9_is_proto_dotu(struct p9_client *clnt)
EXPORT_SYMBOL(p9_is_proto_dotu); EXPORT_SYMBOL(p9_is_proto_dotu);
/* Interpret mount option for protocol version */ /* 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)) { if (!strncmp("9p2000", name->from, name->to-name->from)) {
version = p9_proto_legacy; version = p9_proto_legacy;
P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n"); P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册