Commit 28df30e61b46a33d1f0bb60757747396886ef687
Committed by
Linus Torvalds
1 parent
efc0cfa6d1
Exists in
master
and in
20 other branches
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 <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>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
drivers/rtc/rtc-ds1374.c
... | ... | @@ -283,7 +283,7 @@ |
283 | 283 | |
284 | 284 | stat = i2c_smbus_read_byte_data(client, DS1374_REG_SR); |
285 | 285 | if (stat < 0) |
286 | - return; | |
286 | + goto unlock; | |
287 | 287 | |
288 | 288 | if (stat & DS1374_REG_SR_AF) { |
289 | 289 | stat &= ~DS1374_REG_SR_AF; |
... | ... | @@ -302,7 +302,7 @@ |
302 | 302 | out: |
303 | 303 | if (!ds1374->exiting) |
304 | 304 | enable_irq(client->irq); |
305 | - | |
305 | +unlock: | |
306 | 306 | mutex_unlock(&ds1374->mutex); |
307 | 307 | } |
308 | 308 |