]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
USB: gadget: f_midi: f_midi_complete to call queue_work
authorJill Donahue <jilliandonahue58@gmail.com>
Tue, 11 Feb 2025 17:48:05 +0000 (10:48 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Feb 2025 12:10:47 +0000 (04:10 -0800)
commitdeeee3adb2c01eedab32c3b4519337689ad02e8a
tree5436d55bdba3908f53e498c75599487ad3506b3d
parent859cb45aefa6de823b2fa7f229fe6d9562c9f3b7
USB: gadget: f_midi: f_midi_complete to call queue_work

[ Upstream commit 4ab37fcb42832cdd3e9d5e50653285ca84d6686f ]

When using USB MIDI, a lock is attempted to be acquired twice through a
re-entrant call to f_midi_transmit, causing a deadlock.

Fix it by using queue_work() to schedule the inner f_midi_transmit() via
a high priority work queue from the completion handler.

Link: https://lore.kernel.org/all/CAArt=LjxU0fUZOj06X+5tkeGT+6RbXzpWg1h4t4Fwa_KGVAX6g@mail.gmail.com/
Fixes: d5daf49b58661 ("USB: gadget: midi: add midi function driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Jill Donahue <jilliandonahue58@gmail.com>
Link: https://lore.kernel.org/r/20250211174805.1369265-1-jdonahue@fender.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/gadget/function/f_midi.c