From: Benoit Goby Date: Thu, 10 May 2012 08:07:58 +0000 (+0200) Subject: usb: gadget: composite: Initialize config->interface X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=02e8161e341b4e54a4a36233f98b79763bfa3f48;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Kyungmin Park Acked-by: Michal Nazarewicz Signed-off-by: Greg Kroah-Hartman --- 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, INIT_LIST_HEAD(&config->functions); config->next_interface_id = 0; + memset(config->interface, 0, sizeof(config->interface)); status = bind(config); if (status < 0) {