Commit 2eaaa5ff authored by Jiri Slaby's avatar Jiri Slaby Committed by David Woodhouse

mtd: sst25l, fix lock imbalance

Add an omitted unlock to one sst25l_erase fail path.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent ec77e21b
...@@ -180,8 +180,10 @@ static int sst25l_erase(struct mtd_info *mtd, struct erase_info *instr) ...@@ -180,8 +180,10 @@ static int sst25l_erase(struct mtd_info *mtd, struct erase_info *instr)
mutex_lock(&flash->lock); mutex_lock(&flash->lock);
err = sst25l_wait_till_ready(flash); err = sst25l_wait_till_ready(flash);
if (err) if (err) {
mutex_unlock(&flash->lock);
return err; return err;
}
while (addr < end) { while (addr < end) {
err = sst25l_erase_sector(flash, addr); err = sst25l_erase_sector(flash, addr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment