Common: initialize and modify exception for n_configs 40/151440/1 accepted/tizen/unified/20170921.072638 submit/tizen/20170921.023830
authorlokilee73 <changjoo.lee@samsung.com>
Thu, 21 Sep 2017 02:13:06 +0000 (11:13 +0900)
committerlokilee73 <changjoo.lee@samsung.com>
Thu, 21 Sep 2017 02:13:06 +0000 (11:13 +0900)
Change-Id: I433e9d5a28353cdf5b69837ec6d2f5939369cbbd

hw/usb_gadget/usb_gadget.c

index fcf144c..32641d0 100755 (executable)
@@ -185,7 +185,7 @@ static int simple_id_to_gadget(struct usb_gadget_id *gadget_id,
                               struct usb_gadget **_gadget)
 {
        struct usb_gadget *gadget;
-       int n_configs = 0;
+       unsigned int n_configs = 0;
        /* zero terminates */
        int functions[2][sizeof(gadget_id->function_mask)*8];
        int n_functions;
@@ -285,7 +285,7 @@ static int simple_id_to_gadget(struct usb_gadget_id *gadget_id,
                break;
        };
 
-       if (n_configs > 2 || n_configs <= 0) {
+       if (n_configs > 2 || n_configs == 0) {
                ret = -EINVAL;
                goto free_gadget;
        }