rtc: ds1374, fix lock imbalance
authorJiri Slaby <jirislaby@gmail.com>
Sun, 5 Jul 2009 19:08:03 +0000 (12:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 6 Jul 2009 20:57:03 +0000 (13:57 -0700)
When i2c_smbus_read_byte_data fails in ds1374_work, we forgot to unlock
the held lock.  Fix that.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rtc/rtc-ds1374.c

index 32b27739ec2a4567acd1d2cb2e38535c385d4f27..713f7bf5afb330c508b5d2482804f97ed0083470 100644 (file)
@@ -283,7 +283,7 @@ static void ds1374_work(struct work_struct *work)
 
        stat = i2c_smbus_read_byte_data(client, DS1374_REG_SR);
        if (stat < 0)
-               return;
+               goto unlock;
 
        if (stat & DS1374_REG_SR_AF) {
                stat &= ~DS1374_REG_SR_AF;
@@ -302,7 +302,7 @@ static void ds1374_work(struct work_struct *work)
 out:
        if (!ds1374->exiting)
                enable_irq(client->irq);
-
+unlock:
        mutex_unlock(&ds1374->mutex);
 }