1
0
Fork 0

mtd: sst25l, fix lock imbalance

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>
hifive-unleashed-5.1
Jiri Slaby 2009-09-18 12:51:42 -07:00 committed by David Woodhouse
parent ec77e21b91
commit 2eaaa5ff87
1 changed files with 3 additions and 1 deletions

View 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);