lkml.org 
[lkml]   [2009]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] MTD: sst25l, fix lock imbalance
Date
Add an omitted unlock to one sst25l_erase fail path.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
drivers/mtd/devices/sst25l.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/devices/sst25l.c b/drivers/mtd/devices/sst25l.c
index 1648685..5022ab2 100644
--- a/drivers/mtd/devices/sst25l.c
+++ b/drivers/mtd/devices/sst25l.c
@@ -180,8 +180,10 @@ static int sst25l_erase(struct mtd_info *mtd, struct erase_info *instr)
mutex_lock(&flash->lock);

err = sst25l_wait_till_ready(flash);
- if (err)
+ if (err) {
+ mutex_unlock(&flash->lock);
return err;
+ }

while (addr < end) {
err = sst25l_erase_sector(flash, addr);
--
1.6.3.2


\
 
 \ /
  Last update: 2009-07-13 23:31    [W:0.022 / U:0.428 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site