linux/drivers/media/rc
Ricardo Ribalda 2414789750 media: imon: Fix race getting ictx->lock
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: 23ef710e1a ("[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>
2024-05-31 14:20:40 +02:00
..
img-ir media: img-ir-core: Convert to platform remove callback returning void 2023-04-11 16:59:20 +02:00
keymaps media: rc: keymaps: add missing MODULE_DESCRIPTION to keymaps 2023-10-07 10:55:48 +02:00
ati_remote.c media: rc: ati_remote: increase mouse_name buffer size 2023-09-27 10:47:22 +02:00
bpf-lirc.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-02-22 15:29:26 -08:00
ene_ir.c media: rc: Fix use-after-free bugs caused by ene_tx_irqsim() 2023-02-08 07:49:22 +01:00
ene_ir.h
fintek-cir.c media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow 2022-01-28 19:32:50 +01:00
fintek-cir.h
gpio-ir-recv.c media: rc: gpio-ir-recv: Remove unused of_gpio.h 2024-03-25 10:13:43 +01:00
gpio-ir-tx.c media: rc: gpio-ir-tx: drop of_match_ptr for ID table 2023-07-14 12:32:27 +02:00
igorplugusb.c media: igorplugusb: use correct size pass to igorplugusb_probe() 2022-07-15 14:52:20 +01:00
iguanair.c media: iguanair: no superfluous usb_unlink_urb() 2022-06-20 10:30:33 +01:00
imon_raw.c media: imon_raw: respect DMA coherency 2022-06-20 10:30:33 +01:00
imon.c media: imon: Fix race getting ictx->lock 2024-05-31 14:20:40 +02:00
ir_toy.c media: ir_toy: fix a memleak in irtoy_tx 2024-02-01 13:49:18 +01:00
ir-hix5hd2.c media: ir-hix5hd2: Use device_get_match_data() 2023-11-16 13:56:47 +01:00
ir-imon-decoder.c media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow 2022-01-28 19:32:50 +01:00
ir-jvc-decoder.c media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow 2022-01-28 19:32:50 +01:00
ir-mce_kbd-decoder.c media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow 2022-01-28 19:32:50 +01:00
ir-nec-decoder.c media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow 2022-01-28 19:32:50 +01:00
ir-rc5-decoder.c media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow 2022-01-28 19:32:50 +01:00
ir-rc6-decoder.c media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow 2022-01-28 19:32:50 +01:00
ir-rcmm-decoder.c media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow 2022-01-28 19:32:50 +01:00
ir-sanyo-decoder.c media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow 2022-01-28 19:32:50 +01:00
ir-sharp-decoder.c media: sharp: fix sharp encoding 2023-10-11 16:26:16 +02:00
ir-sony-decoder.c media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow 2022-01-28 19:32:50 +01:00
ir-spi.c media: ir-spi: Unify indentation and comment style 2024-03-25 10:13:44 +01:00
ir-xmp-decoder.c media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow 2022-01-28 19:32:50 +01:00
ite-cir.c media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow 2022-01-28 19:32:50 +01:00
ite-cir.h
Kconfig media: pwm-ir-tx: Depend on CONFIG_HIGH_RES_TIMERS 2024-02-01 13:49:39 +01:00
lirc_dev.c media: lirc_dev: Make lirc_class constant 2024-03-25 10:13:44 +01:00
Makefile media: rc: remove ir-rx51 in favour of generic pwm-ir-tx 2023-09-27 09:40:02 +02:00
mceusb.c media: mceusb: No need for vendor/product ID in name 2024-05-31 14:20:40 +02:00
meson-ir-tx.c media: meson-ir-tx: Drop usage of platform_driver_probe() 2023-11-16 13:56:48 +01:00
meson-ir.c media: rc: meson-ir: support rc driver type RC_DRIVER_SCANCODE 2023-09-27 09:40:02 +02:00
mtk-cir.c media: rc: add missing io.h 2024-05-08 08:41:27 -07:00
nuvoton-cir.c media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow 2022-01-28 19:32:50 +01:00
nuvoton-cir.h
pwm-ir-tx.c media: pwm-ir-tx: Trigger edges from hrtimer interrupt context 2023-12-20 16:12:49 +01:00
rc-core-priv.h media: rc: bpf attach/detach requires write permission 2024-02-01 13:48:57 +01:00
rc-ir-raw.c media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow 2022-01-28 19:32:50 +01:00
rc-loopback.c media: lirc: report ir receiver overflow 2022-01-28 19:32:50 +01:00
rc-main.c driver core: make struct device_type.uevent() take a const * 2023-01-27 13:45:36 +01:00
redrat3.c media: redrat3: no unnecessary GFP_ATOMIC 2022-06-20 10:30:33 +01:00
serial_ir.c media: rc: add missing io.h 2024-05-08 08:41:27 -07:00
st_rc.c media: rc: add missing io.h 2024-05-08 08:41:27 -07:00
streamzap.c media: streamzap: avoid unnecessary GFP_ATOMIC 2022-06-20 10:30:33 +01:00
sunxi-cir.c media: rc: add missing io.h 2024-05-08 08:41:27 -07:00
ttusbir.c media: ttusbir: avoid unnecessary usb_unlink_urb() 2022-06-20 10:30:33 +01:00
winbond-cir.c media: rc-core: rename ir_raw_event_reset to ir_raw_event_overflow 2022-01-28 19:32:50 +01:00
xbox_remote.c media: xbox_remote: xbox_remote_initialize() cannot fail 2022-06-20 10:30:33 +01:00