]> git.karo-electronics.de Git - linux-beck.git/commit
usb: gadget: rndis: use signed type for a signed value
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Mon, 18 May 2015 15:40:04 +0000 (17:40 +0200)
committerFelipe Balbi <balbi@ti.com>
Thu, 21 May 2015 21:29:14 +0000 (16:29 -0500)
commit81dff8692865292aa70ec3fd93489ae9f33f709e
tree5bdc26bb459ae02e9be6dfbd9722b31ff4ca7c20
parentc0d96af2e0427cc90b1f0d3c6a5294d90f93fcf4
usb: gadget: rndis: use signed type for a signed value

rndis_get_nr() returns either a non-negative value on success
or a negative value on failure. In case of failure an error code
is returned to the caller of rndis_register().
If the "i" is unsigned, the information about error from rndis_get_nr()
is lost. If there is no error but rndis_get_nr() returns a value greater
than 256 the least significant bits of i are zero effectively limiting the
number of configs to 256.

This patch fixes that.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/function/rndis.c
drivers/usb/gadget/function/rndis.h