summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManu Gautam <mgautam@codeaurora.org>2017-01-30 10:29:01 +0530
committerHemant Kumar <hemantk@codeaurora.org>2017-03-02 13:30:20 -0800
commit38fb1003b109a0cab19cd26c027173b96e5fa69d (patch)
tree69f601c5022920ebd15f764c54861d37cbe0ede9
parent660ab6c3a2409a5de73575976a321b8ae7a4889b (diff)
USB: gadget: midi: Replace snd_card_free with snd_card_free_closed
snd_card_free is a blocking function which waits for ALSA device to be closed before freeing it. This could be blocked forever if userspace has device node opened when midi function is unbound. Replace it with snd_card_free_when_closed which can be safely used if userspce has the device node opened. It is not a blocking function and defers freeing of the card until userspace closes the ALSA device. Change-Id: I6becc44dc0f0c1131f9b7dcd1e4a151d830dde2b CRs-fixed: 1116790 Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
-rw-r--r--drivers/usb/gadget/function/f_midi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
index 8919cc26b98e..5bcff5d2cd8d 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -1160,7 +1160,7 @@ static void f_midi_unbind(struct usb_configuration *c, struct usb_function *f)
card = midi->card;
midi->card = NULL;
if (card)
- snd_card_free(card);
+ snd_card_free_when_closed(card);
usb_free_all_descriptors(f);
}