Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200670
b: refs/heads/master
c: f588c0d
h: refs/heads/master
v: v3
  • Loading branch information
Michal Nazarewicz authored and Greg Kroah-Hartman committed Jun 30, 2010
1 parent 9df1cf2 commit 4208d92
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b23097b793081358a6d943263c91bae4c955c4e3
refs/heads/master: f588c0db39ca35f69f815dabe5682759daa25098
11 changes: 11 additions & 0 deletions trunk/drivers/usb/gadget/g_ffs.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,17 @@ static int __gfs_do_config(struct usb_configuration *c,
if (unlikely(ret < 0))
return ret;

/* After previous do_configs there may be some invalid
* pointers in c->interface array. This happens every time
* a user space function with fewer interfaces than a user
* space function that was run before the new one is run. The
* compasit's set_config() assumes that if there is no more
* then MAX_CONFIG_INTERFACES interfaces in a configuration
* then there is a NULL pointer after the last interface in
* c->interface array. We need to make sure this is true. */
if (c->next_interface_id < ARRAY_SIZE(c->interface))
c->interface[c->next_interface_id] = NULL;

return 0;
}

Expand Down

0 comments on commit 4208d92

Please sign in to comment.