lkml.org 
[lkml]   [2009]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] RTC: ds1374, fix lock imbalance
Date
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>
---
drivers/rtc/rtc-ds1374.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c
index 32b2773..713f7bf 100644
--- a/drivers/rtc/rtc-ds1374.c
+++ b/drivers/rtc/rtc-ds1374.c
@@ -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);
}

--
1.6.3.2


\
 
 \ /
  Last update: 2009-06-19 17:57    [W:0.024 / U:0.896 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site