usb: gadget: f_fs: signedness bug in __ffs_func_bind_do_descs()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 9 Sep 2014 12:06:09 +0000 (15:06 +0300)
committerFelipe Balbi <balbi@ti.com>
Tue, 9 Sep 2014 14:51:21 +0000 (09:51 -0500)
We need "idx" to be signed for the error handling to work.

Fixes: 6d5c1c77bbf9 ('usb: gadget: f_fs: fix the redundant ep files problem')
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/function/f_fs.c

index dc30adf15a01d22cbde3c3a195a146373e302ef0..1aad353c1f116335a1cd013be55453e4fbc87fe1 100644 (file)
@@ -2352,7 +2352,8 @@ static int __ffs_func_bind_do_descs(enum ffs_entity_type type, u8 *valuep,
        struct usb_endpoint_descriptor *ds = (void *)desc;
        struct ffs_function *func = priv;
        struct ffs_ep *ffs_ep;
-       unsigned ep_desc_id, idx;
+       unsigned ep_desc_id;
+       int idx;
        static const char *speed_names[] = { "full", "high", "super" };
 
        if (type != FFS_DESCRIPTOR)