diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2009-09-18 21:51:42 +0200 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-09-19 19:56:53 +0200 |
commit | 2eaaa5ff87c675aacd3a869fc5fe75a35bbd5278 (patch) | |
tree | 5224bbf24266e1025e08a109b493f932a2dac7bd /drivers | |
parent | mtd: SST25L (non JEDEC) SPI Flash driver (diff) | |
download | linux-2eaaa5ff87c675aacd3a869fc5fe75a35bbd5278.tar.xz linux-2eaaa5ff87c675aacd3a869fc5fe75a35bbd5278.zip |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | 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 ac7d52b420cc..c2baf3353f84 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); |