diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2012-03-06 15:08:16 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-19 13:36:17 -0400 |
commit | 9bb24a7e49c33c16c4d9d7d3496f46626e573d02 (patch) | |
tree | b289561a5e87c41b585f24206dfb65a20c4b69dd /drivers/media/dvb/frontends | |
parent | b47acf2a161b2f3001bf50dfa740477db6d32327 (diff) |
[media] dib9000: fix explicit lock mismatches
There are several error paths, where &state->platform.risc.mem_mbx_lock
is not unlocked. The patch fixes it.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r-- | drivers/media/dvb/frontends/dib9000.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/dvb/frontends/dib9000.c b/drivers/media/dvb/frontends/dib9000.c index 863ef3cfab9f..d96b6a1e65d9 100644 --- a/drivers/media/dvb/frontends/dib9000.c +++ b/drivers/media/dvb/frontends/dib9000.c | |||
@@ -2208,6 +2208,7 @@ static int dib9000_read_signal_strength(struct dvb_frontend *fe, u16 * strength) | |||
2208 | 2208 | ||
2209 | DibAcquireLock(&state->platform.risc.mem_mbx_lock); | 2209 | DibAcquireLock(&state->platform.risc.mem_mbx_lock); |
2210 | if (dib9000_fw_memmbx_sync(state, FE_SYNC_CHANNEL) < 0) { | 2210 | if (dib9000_fw_memmbx_sync(state, FE_SYNC_CHANNEL) < 0) { |
2211 | DibReleaseLock(&state->platform.risc.mem_mbx_lock); | ||
2211 | ret = -EIO; | 2212 | ret = -EIO; |
2212 | goto error; | 2213 | goto error; |
2213 | } | 2214 | } |
@@ -2233,8 +2234,10 @@ static u32 dib9000_get_snr(struct dvb_frontend *fe) | |||
2233 | u16 val; | 2234 | u16 val; |
2234 | 2235 | ||
2235 | DibAcquireLock(&state->platform.risc.mem_mbx_lock); | 2236 | DibAcquireLock(&state->platform.risc.mem_mbx_lock); |
2236 | if (dib9000_fw_memmbx_sync(state, FE_SYNC_CHANNEL) < 0) | 2237 | if (dib9000_fw_memmbx_sync(state, FE_SYNC_CHANNEL) < 0) { |
2238 | DibReleaseLock(&state->platform.risc.mem_mbx_lock); | ||
2237 | return -EIO; | 2239 | return -EIO; |
2240 | } | ||
2238 | dib9000_risc_mem_read(state, FE_MM_R_FE_MONITOR, (u8 *) c, 16 * 2); | 2241 | dib9000_risc_mem_read(state, FE_MM_R_FE_MONITOR, (u8 *) c, 16 * 2); |
2239 | DibReleaseLock(&state->platform.risc.mem_mbx_lock); | 2242 | DibReleaseLock(&state->platform.risc.mem_mbx_lock); |
2240 | 2243 | ||
@@ -2291,6 +2294,7 @@ static int dib9000_read_unc_blocks(struct dvb_frontend *fe, u32 * unc) | |||
2291 | DibAcquireLock(&state->demod_lock); | 2294 | DibAcquireLock(&state->demod_lock); |
2292 | DibAcquireLock(&state->platform.risc.mem_mbx_lock); | 2295 | DibAcquireLock(&state->platform.risc.mem_mbx_lock); |
2293 | if (dib9000_fw_memmbx_sync(state, FE_SYNC_CHANNEL) < 0) { | 2296 | if (dib9000_fw_memmbx_sync(state, FE_SYNC_CHANNEL) < 0) { |
2297 | DibReleaseLock(&state->platform.risc.mem_mbx_lock); | ||
2294 | ret = -EIO; | 2298 | ret = -EIO; |
2295 | goto error; | 2299 | goto error; |
2296 | } | 2300 | } |