usb: gadget: composite: Initialize config->interface
authorBenoit Goby <benoit@android.com>
Thu, 10 May 2012 08:07:58 +0000 (10:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 May 2012 19:21:32 +0000 (12:21 -0700)
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>
drivers/usb/gadget/composite.c

index e51b231..a8b8ab8 100644 (file)
@@ -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) {