Hi, Jerry Zhang <zhangjerry@xxxxxxxxxx> writes: > Currently, f_midi_free uses snd_card_free, which will wait > until the user has released the sound card before > returning. However, if the user doesn't release the sound > card, then f_midi_free can block for an arbitrary amount > of time, which also blocks any gadget operations on that > thread. > > Instead, we can use snd_card_free_when_closed which returns > before all handles are released. Since f_midi can be > accessed through rmidi if usb_put_function is called before > release_card_device, add refcounting to f_midi_free and > have rawmidi's private free call it. The f_midi memory > is only kfreed when usb_put_function and release_card_device > have both been called. Also make use of refcnt in freeing > f_midi_opts. The opts are only freed after the config > items are released and all associated f_midi functions > are freed. > > Signed-off-by: Jerry Zhang <zhangjerry@xxxxxxxxxx> > --- > I see that this patch is already in Greg's tree. Can it still > be updated, or should I submit these changes as a new patch? new, incremental change -- balbi
Attachment:
signature.asc
Description: PGP signature