media: ttusb-dec: avoid release of non-acquired mutex
authorEvgeny Novikov <novikov@ispras.ru>
Tue, 20 Jul 2021 09:28:27 +0000 (11:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:27 +0000 (19:16 +0100)
commit98cb3a055b18cee34e78dc4249a0eb539ce9eee3
tree8bd8607a21e7e176b3587dc933e1d92628e8e255
parentf8b2ae89671d42483ec880acdf2a7d3b607bd31e
media: ttusb-dec: avoid release of non-acquired mutex

[ Upstream commit 36b9d695aa6fb8e9a312db21af41f90824d16ab4 ]

ttusb_dec_send_command() invokes mutex_lock_interruptible() that can
fail but then it releases the non-acquired mutex. The patch fixes that.

Found by Linux Driver Verification project (linuxtesting.org).

Fixes: dba328bab4c6 ("media: ttusb-dec: cleanup an error handling logic")
Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/usb/ttusb-dec/ttusb_dec.c