From 02e8161e341b4e54a4a36233f98b79763bfa3f48 Mon Sep 17 00:00:00 2001 From: Benoit Goby Date: Thu, 10 May 2012 10:07:58 +0200 Subject: [PATCH] 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 --- drivers/usb/gadget/composite.c | 1 + 1 file changed, 1 insertion(+) 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) { -- GitLab