summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/function/rndis.c
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2015-05-18 18:40:04 +0300
committerFelipe Balbi <balbi@ti.com>2015-05-22 00:29:14 +0300
commit81dff8692865292aa70ec3fd93489ae9f33f709e (patch)
tree5bdc26bb459ae02e9be6dfbd9722b31ff4ca7c20 /drivers/usb/gadget/function/rndis.c
parentc0d96af2e0427cc90b1f0d3c6a5294d90f93fcf4 (diff)
downloadlinux-81dff8692865292aa70ec3fd93489ae9f33f709e.tar.xz
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>
Diffstat (limited to 'drivers/usb/gadget/function/rndis.c')
-rw-r--r--drivers/usb/gadget/function/rndis.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/gadget/function/rndis.c b/drivers/usb/gadget/function/rndis.c
index aac59c03a732..70d3917cc003 100644
--- a/drivers/usb/gadget/function/rndis.c
+++ b/drivers/usb/gadget/function/rndis.c
@@ -872,7 +872,7 @@ static inline void rndis_put_nr(int nr)
struct rndis_params *rndis_register(void (*resp_avail)(void *v), void *v)
{
struct rndis_params *params;
- u8 i;
+ int i;
if (!resp_avail)
return ERR_PTR(-EINVAL);
@@ -923,7 +923,7 @@ EXPORT_SYMBOL_GPL(rndis_register);
void rndis_deregister(struct rndis_params *params)
{
- u8 i;
+ int i;
pr_debug("%s:\n", __func__);