Subject: bug report: 9p: 9P2010.L handshake: Add mount option

From: Dan Carpenter <[email-masked]>
Date: Sat, 6 Mar 2010 15:22:45 +0300

+static unsigned char get_protocol_version(const substring_t *name)
+{
+       unsigned char version = -EINVAL;

Assigning a negative value to an unsigned char is problematic.  (If it's 
an unsigned int or long that's different).

I have included a test program to illustrate.

regards,
dan carpenter

#include <stdio.h>

unsigned char n22(void) { return -22; }

int main()
{
	int ret = n22();

	if (ret == -22)
		printf("true\n");
	else 
		printf("false\n");
}