Skip to contentSkip to conversation

RTC: ds1374, fix lock imbalance

PATCH New Jiri Slaby 1 participant 1 message Jun 19, 2009 Real time clock (RTC)

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/1 RTC: ds1374, fix lock imbalance

When i2c_smbus_read_byte_data fails in ds1374_work, we forgot to unlock the held lock. Fix that.

---
 drivers/rtc/rtc-ds1374.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/rtc/rtc-ds1374.c +2 -2
index 32b2773..713f7bf 100644
@@ -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);
 }
 
Signature · 1 line
1.6.3.2