Merge "usb: gadget: f_midi: Fix use after free bug"
This commit is contained in:
commit
1f7a8f328d
1 changed files with 1 additions and 0 deletions
|
@ -1139,6 +1139,7 @@ static void f_midi_free(struct usb_function *f)
|
||||||
mutex_lock(&opts->lock);
|
mutex_lock(&opts->lock);
|
||||||
for (i = opts->in_ports - 1; i >= 0; --i)
|
for (i = opts->in_ports - 1; i >= 0; --i)
|
||||||
kfree(midi->in_port[i]);
|
kfree(midi->in_port[i]);
|
||||||
|
opts->func_inst.f = NULL;
|
||||||
kfree(midi);
|
kfree(midi);
|
||||||
--opts->refcnt;
|
--opts->refcnt;
|
||||||
mutex_unlock(&opts->lock);
|
mutex_unlock(&opts->lock);
|
||||||
|
|
Loading…
Add table
Reference in a new issue