usb: gadget: function: fix missing spinlock in f_uac1_legacy
authorZhang Qiang <qiang.zhang@windriver.com>
Mon, 6 Jul 2020 05:14:55 +0000 (13:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jul 2020 07:10:52 +0000 (09:10 +0200)
commitcc5f881f0f358614f8469a08633ed9fa687c2851
tree7b4d9236642660464cac18e361fbd0efe12d1aab
parentb3cfd4d21add387a215c512efd31076b2e3eed71
usb: gadget: function: fix missing spinlock in f_uac1_legacy

commit 8778eb0927ddcd3f431805c37b78fa56481aeed9 upstream.

Add a missing spinlock protection for play_queue, because
the play_queue may be destroyed when the "playback_work"
work func and "f_audio_out_ep_complete" callback func
operate this paly_queue at the same time.

Fixes: c6994e6f067cf ("USB: gadget: add USB Audio Gadget driver")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Zhang Qiang <qiang.zhang@windriver.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_uac1.c