Skip to contentSkip to conversation

MTD: sst25l, fix lock imbalance

PATCH New Jiri Slaby 1 participant 1 message Jul 13, 2009 Memory technology devices (MTD)

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/1 MTD: sst25l, fix lock imbalance

Add an omitted unlock to one sst25l_erase fail path.

---
 drivers/mtd/devices/sst25l.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/mtd/devices/sst25l.c +3 -1
index 1648685..5022ab2 100644
@@ -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);
Signature · 1 line
1.6.3.2