USB: gadget: f_audio_source: Fix use after free in audio_unbind
authorMike Lockwood <lockwood@google.com>
Thu, 16 Aug 2012 02:58:28 +0000 (19:58 -0700)
committerandroid code review <noreply-gerritcodereview@google.com>
Thu, 16 Aug 2012 19:52:33 +0000 (12:52 -0700)
commit54c7c33ce2cf80a561fcc5f83099c9150de6fe44
tree5a75e333284dbf0710914777f3bb859a32191de9
parentd4bad8b2ea1c76b0c5ea55fbbf04e2115f560c22
USB: gadget: f_audio_source: Fix use after free in audio_unbind

When USB was disconnected, we were freeing our audio_dev struct in audio_unbind
before the audio system had cleaned up, resulting in a hang in audio_pcm_close.
We now statically allocate the audio_dev struct to avoid this problem.

Change-Id: I58ad21eaa20dcf4aa74ee614ef3b6ed2c91d52a1
Signed-off-by: Mike Lockwood <lockwood@google.com>
drivers/usb/gadget/f_audio_source.c