summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Goby <benoit@android.com>2012-05-10 10:07:58 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-10 12:21:32 -0700
commit02e8161e341b4e54a4a36233f98b79763bfa3f48 (patch)
tree7521e17e3fa102d185d7b497473c9618672dc167
parent51cce6fc155c4d7eea2ff975ee7c82b89332c6d9 (diff)
downloadop-kernel-dev-02e8161e341b4e54a4a36233f98b79763bfa3f48.zip
op-kernel-dev-02e8161e341b4e54a4a36233f98b79763bfa3f48.tar.gz
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>
-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 e51b231..a8b8ab8 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,
INIT_LIST_HEAD(&config->functions);
config->next_interface_id = 0;
+ memset(config->interface, 0, sizeof(config->interface));
status = bind(config);
if (status < 0) {
OpenPOWER on IntegriCloud