From: Jiri Slaby Date: Fri, 18 Sep 2009 19:51:42 +0000 (-0700) Subject: mtd: sst25l, fix lock imbalance X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2eaaa5ff87c675aacd3a869fc5fe75a35bbd5278;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git mtd: sst25l, fix lock imbalance Add an omitted unlock to one sst25l_erase fail path. Signed-off-by: Jiri Slaby Signed-off-by: Andrew Morton Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- 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);