]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (4849): Add missing spin_unlock to saa6588 decoder driver
authorIra Snyder <kernel@irasnyder.com>
Mon, 20 Nov 2006 10:20:48 +0000 (07:20 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 26 Nov 2006 10:52:37 +0000 (08:52 -0200)
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>
drivers/media/video/saa6588.c

index a81285ca7d5bcbb98d54f8bb326536e064442815..7b9859c33018e41803be47f094626cd6b17409c2 100644 (file)
@@ -212,8 +212,10 @@ static void read_from_buf(struct saa6588 *s, struct rds_command *a)
        if (rd_blocks > s->block_count)
                rd_blocks = s->block_count;
 
-       if (!rd_blocks)
+       if (!rd_blocks) {
+               spin_unlock_irqrestore(&s->lock, flags);
                return;
+       }
 
        for (i = 0; i < rd_blocks; i++) {
                if (block_to_user_buf(s, buf_ptr)) {