From: Jiri Slaby Date: Sun, 5 Jul 2009 19:08:03 +0000 (-0700) Subject: rtc: ds1374, fix lock imbalance X-Git-Tag: v2.6.31-rc3~86 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28df30e61b46a33d1f0bb60757747396886ef687;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git rtc: ds1374, fix lock imbalance When i2c_smbus_read_byte_data fails in ds1374_work, we forgot to unlock the held lock. Fix that. Signed-off-by: Jiri Slaby Cc: Alessandro Zummo Cc: Scott Wood Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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); }