diff options
| author | Ricardo Ribalda <[email protected]> | 2024-05-06 21:10:27 +0000 |
|---|---|---|
| committer | Hans Verkuil <[email protected]> | 2024-05-31 14:20:40 +0200 |
| commit | 24147897507cd3a7d63745d1518a638bf4132238 (patch) | |
| tree | 8a76ff4e635b15a110af992806c5e33e69c876e5 /tools/perf/scripts/python/sched-migration.py | |
| parent | 2052138b7da52ad5ccaf74f736d00f39a1c9198c (diff) | |
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: 23ef710e1a6c ("[media] imon: add conditional locking in change_protocol")
Signed-off-by: Ricardo Ribalda <[email protected]>
Signed-off-by: Sean Young <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/sched-migration.py')
0 files changed, 0 insertions, 0 deletions