usbip: stub_dev.c: store_sockfd() + sockfd variable?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm looking at the kernel source code of the USBIP and also tired to
compile the sources with "make W=1 modules". One of the warning messages
looks like:

drivers/staging/usbip/stub_dev.c:126: warning: conversion to âunsigned intâ from âintâ may change the sign of the result

This is because the "sockfd" local variable in store_sockfd() is "int"
and the sockfd_to_socket() function takes an "unsigned int" parameter
which in turn calls fget() function from linux/file.h, also taking
"unsigned int" parameter.

It is mentioned in the comment that "-1 is a magic number by which usbip
connection is finished". OK, so given the all the possible file descriptors
the USBIP excludes -1.

Lets take a system with 32bit int. In this case USBIP can handle file
descriptors 0...0x7FFF_FFFF (0...2147483647). What about the file descriptors
0x8000_0000...0xFFFF_FFFE (2147483648...4294967294)?

Regards,

	MÃrton NÃmeth

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux