diff options
author | lokilee73 <changjoo.lee@samsung.com> | 2017-09-26 12:58:58 +0900 |
---|---|---|
committer | lokilee73 <changjoo.lee@samsung.com> | 2017-09-26 12:59:11 +0900 |
commit | 61abd9ddcd2e00098ec4393ef43a989b8e4f4171 (patch) | |
tree | 5b9a0d43f9497f994dfd4c768d9a47cea2022048 | |
parent | 0c663020fc164041674d4de91a87588d796059c2 (diff) | |
download | device-manager-plugin-artik-61abd9ddcd2e00098ec4393ef43a989b8e4f4171.tar.gz device-manager-plugin-artik-61abd9ddcd2e00098ec4393ef43a989b8e4f4171.tar.bz2 device-manager-plugin-artik-61abd9ddcd2e00098ec4393ef43a989b8e4f4171.zip |
Common: initialize and modify exception for n_configssubmit/tizen/20170926.040557
Change-Id: I230d273c5ca65874f67164a7063964577b53e498
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
-rwxr-xr-x[-rw-r--r--] | hw/usb_gadget/usb_gadget.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/usb_gadget/usb_gadget.c b/hw/usb_gadget/usb_gadget.c index 0bcb10b..32641d0 100644..100755 --- a/hw/usb_gadget/usb_gadget.c +++ b/hw/usb_gadget/usb_gadget.c @@ -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; + 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) { + if (n_configs > 2 || n_configs == 0) { ret = -EINVAL; goto free_gadget; } |