summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-11-20 08:20:48 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-11-20 08:20:48 -0200
commit64f1423a469bd3837f84cbf807ba60b113c07245 (patch)
tree2c418736ebd5ae6f016590f76ec630ce5a714539 /linux/drivers/media
parent17f326133bb934374337530203b3ae0013c5ed28 (diff)
downloadmediapointer-dvb-s2-64f1423a469bd3837f84cbf807ba60b113c07245.tar.gz
mediapointer-dvb-s2-64f1423a469bd3837f84cbf807ba60b113c07245.tar.bz2
Add missing spin_unlock to saa6588 decoder driver
From: Ira Snyder <kernel@irasnyder.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@irasnyder.com> Signed-off-by: Hans J. Koch <koch@hjk-az.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/saa6588.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/linux/drivers/media/video/saa6588.c b/linux/drivers/media/video/saa6588.c
index 02709340b..4b2375c80 100644
--- a/linux/drivers/media/video/saa6588.c
+++ b/linux/drivers/media/video/saa6588.c
@@ -219,8 +219,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)) {