aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIra Snyder <kernel@irasnyder.com>2006-11-20 05:20:48 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-11-26 05:52:37 -0500
commita5bbc7d94cf1dcb2100eeaf68791a401ad7ce54d (patch)
tree88812d920d7a50a63abe123a7618c5eac2c6272a
parent30d9464c76743160612e7de0b2f5f656c78915d3 (diff)
V4L/DVB (4849): Add missing spin_unlock to saa6588 decoder driver
Sparse noticed a lock imbalance in read_from_buf(). Further inspection shows that the lock should not be held when the function exits. This adds a spin_unlock_irqrestore(), so that every exit path of the read_from_buf() function is consistent. The unlock was missing on an error path. Signed-off-by: Ira W. Snyder <devel@irasnyder.com> Signed-off-by: Hans J. Koch <koch@hjk-az.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/video/saa6588.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/video/saa6588.c b/drivers/media/video/saa6588.c
index a81285ca7d5b..7b9859c33018 100644
--- a/drivers/media/video/saa6588.c
+++ b/drivers/media/video/saa6588.c
@@ -212,8 +212,10 @@ static void read_from_buf(struct saa6588 *s, struct rds_command *a)
212 if (rd_blocks > s->block_count) 212 if (rd_blocks > s->block_count)
213 rd_blocks = s->block_count; 213 rd_blocks = s->block_count;
214 214
215 if (!rd_blocks) 215 if (!rd_blocks) {
216 spin_unlock_irqrestore(&s->lock, flags);
216 return; 217 return;
218 }
217 219
218 for (i = 0; i < rd_blocks; i++) { 220 for (i = 0; i < rd_blocks; i++) {
219 if (block_to_user_buf(s, buf_ptr)) { 221 if (block_to_user_buf(s, buf_ptr)) {