Skip to content

Commit

Permalink
mtd: sst25l, fix lock imbalance
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Slaby authored and David Woodhouse committed Sep 19, 2009
1 parent ec77e21 commit 2eaaa5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/mtd/devices/sst25l.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2eaaa5f

Please sign in to comment.