mtd: sst25l, fix lock imbalance

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Sep 19 14:59:01 EDT 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=2eaaa5ff87c675aacd3a869fc5fe75a35bbd5278
Commit:     2eaaa5ff87c675aacd3a869fc5fe75a35bbd5278
Parent:     ec77e21b91f0393a5201cfd4571a82ab7d64fd29
Author:     Jiri Slaby <jirislaby at gmail.com>
AuthorDate: Fri Sep 18 12:51:42 2009 -0700
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Sat Sep 19 10:56:53 2009 -0700

    mtd: sst25l, fix lock imbalance
    
    Add an omitted unlock to one sst25l_erase fail path.
    
    Signed-off-by: Jiri Slaby <jirislaby at gmail.com>
    Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.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 ac7d52b..c2baf33 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);



More information about the linux-mtd-cvs mailing list