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:34:18 +0000 (09:34 +0200)
commitf07c5414c9ebb84a561ec05337d8e92a021e00a4
tree6ecb4435935ef7dbde0b870af42d6490cfd05938
parentcb6b9388811df0ff5913ccb7881d7fda2490b7a5
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_legacy.c