mtd: sst25l, fix lock imbalance
authorJiri Slaby <jirislaby@gmail.com>
Fri, 18 Sep 2009 19:51:42 +0000 (12:51 -0700)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sat, 19 Sep 2009 17:56:53 +0000 (10:56 -0700)
Add an omitted unlock to one sst25l_erase fail path.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/devices/sst25l.c

index ac7d52b420cccdcf8c58bbe79293e2b586f8579e..c2baf3353f84d718135a72fdff1d8aa23c2efdfe 100644 (file)
@@ -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);