aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorBenoit Goby <benoit@android.com>2012-05-10 04:07:58 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-10 15:21:32 -0400
commit02e8161e341b4e54a4a36233f98b79763bfa3f48 (patch)
tree7521e17e3fa102d185d7b497473c9618672dc167 /drivers/usb/gadget
parent51cce6fc155c4d7eea2ff975ee7c82b89332c6d9 (diff)
usb: gadget: composite: Initialize config->interface
Reset config->interface in usb_add_config, as it may contain pointers to functions from a previous session if config is removed and re-added. Signed-off-by: Benoit Goby <benoit@android.com> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/composite.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index e51b2314f5c9..a8b8ab80bc77 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -734,6 +734,7 @@ int usb_add_config(struct usb_composite_dev *cdev,
734 734
735 INIT_LIST_HEAD(&config->functions); 735 INIT_LIST_HEAD(&config->functions);
736 config->next_interface_id = 0; 736 config->next_interface_id = 0;
737 memset(config->interface, 0, sizeof(config->interface));
737 738
738 status = bind(config); 739 status = bind(config);
739 if (status < 0) { 740 if (status < 0) {