* [BUG] media: dvb: dib9000: buggy locking
@ 2011-01-19 13:10 Vasiliy Kulikov
0 siblings, 0 replies; only message in thread
From: Vasiliy Kulikov @ 2011-01-19 13:10 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: Patrick Boettcher, Olivier Grenie, linux-media, linux-kernel
Hi,
I've noticed that locking in drivers/media/dvb/frontends/dib9000.c is
not correct:
static int dib9000_fw_get_channel(...)
{
...
DibAcquireLock(&state->platform.risc.mem_mbx_lock);
...
error:
DibReleaseLock(&state->platform.risc.mem_mbx_lock);
return ret;
}
#define DibAcquireLock(lock) do { if (mutex_lock_interruptible(lock) < 0) dprintk("could not get the lock"); } while (0)
#define DibReleaseLock(lock) mutex_unlock(lock)
1) If mutex is not hold, then the critical section is not protected.
2) If mutex was not hold, then the code tries to release not holded
mutex.
This locking "style" is used all over the driver.
Thanks,
--
Vasiliy Kulikov
http://www.openwall.com - bringing security into open computing environments
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-01-19 13:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-19 13:10 [BUG] media: dvb: dib9000: buggy locking Vasiliy Kulikov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox