[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-id: <20061121123850.PS5395860004@infradead.org>
Date: Tue, 21 Nov 2006 10:38:50 -0200
From: mchehab@...radead.org
To: linux-kernel@...r.kernel.org
Cc: linux-dvb-maintainer@...uxtv.org,
Ira Snyder <kernel@...snyder.com>,
"Ira W. Snyder" <devel@...snyder.com>,
"Hans J. Koch" <koch@...-az.de>,
Mauro Carvalho Chehab <mchehab@...radead.org>
Subject: [PATCH 4/5] V4L/DVB (4849): Add missing spin_unlock to saa6588
decoder driver
From: Ira Snyder <kernel@...snyder.com>
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@...snyder.com>
Signed-off-by: Hans J. Koch <koch@...-az.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@...radead.org>
---
drivers/media/video/saa6588.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/media/video/saa6588.c b/drivers/media/video/saa6588.c
index a81285c..7b9859c 100644
--- a/drivers/media/video/saa6588.c
+++ b/drivers/media/video/saa6588.c
@@ -212,8 +212,10 @@ static void read_from_buf(struct saa6588
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)) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists