Skip to content

Commit

Permalink
usb: gadget: composite: Initialize config->interface
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benoit Goby authored and Greg Kroah-Hartman committed May 10, 2012
1 parent 51cce6f commit 02e8161
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/gadget/composite.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 02e8161

Please sign in to comment.