kernel_samsung_a53x/drivers/media/rc
Ricardo Ribalda c775d4ff02 media: imon: Fix race getting ictx->lock
[ Upstream commit 24147897507cd3a7d63745d1518a638bf4132238 ]

Lets fix a race between mutex_is_lock() and mutex_lock().

<-mutex is not locked
if (!mutex_is_locked(&ictx->lock)) {
	unlock = true; <- mutex is locked externaly
	mutex_lock(&ictx->lock);
}

Let's use mutex_trylock() that does mutex_is_lock() and mutex_lock()
atomically.

Fix the following cocci warning:
drivers/media/rc/imon.c:1167:1-7: preceding lock on line 1153

Fixes: 23ef710e1a6c ("[media] imon: add conditional locking in change_protocol")
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:20:08 +01:00
..
img-ir Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
keymaps Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ati_remote.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bpf-lirc.c media: rc: bpf attach/detach requires write permission 2024-11-18 12:13:31 +01:00
ene_ir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ene_ir.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fintek-cir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fintek-cir.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gpio-ir-recv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gpio-ir-tx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
igorplugusb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
iguanair.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
imon.c media: imon: Fix race getting ictx->lock 2024-11-23 23:20:08 +01:00
imon_raw.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ir-hix5hd2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ir-imon-decoder.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ir-jvc-decoder.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ir-mce_kbd-decoder.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ir-nec-decoder.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ir-rc5-decoder.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ir-rc6-decoder.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ir-rcmm-decoder.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ir-rx51.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ir-sanyo-decoder.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ir-sharp-decoder.c media: sharp: fix sharp encoding 2024-11-18 11:43:31 +01:00
ir-sony-decoder.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ir-spi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ir-xmp-decoder.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ir_toy.c media: ir_toy: fix a memleak in irtoy_tx 2024-11-18 12:13:29 +01:00
ite-cir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ite-cir.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lirc_dev.c media: rc: bpf attach/detach requires write permission 2024-11-18 12:13:31 +01:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mceusb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
meson-ir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mtk-cir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nuvoton-cir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nuvoton-cir.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pwm-ir-tx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rc-core-priv.h media: rc: bpf attach/detach requires write permission 2024-11-18 12:13:31 +01:00
rc-ir-raw.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rc-loopback.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rc-main.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
redrat3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
serial_ir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sir_ir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
st_rc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
streamzap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sunxi-cir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tango-ir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ttusbir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
winbond-cir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xbox_remote.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
zx-irdec.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00