Skip to content

Commit

Permalink
rtc: ds1374, fix lock imbalance
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Jul 6, 2009
1 parent efc0cfa commit 28df30e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/rtc/rtc-ds1374.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

Expand Down

0 comments on commit 28df30e

Please sign in to comment.