Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jiri Slaby and committed by
David Woodhouse
2eaaa5ff ec77e21b

+3 -1
+3 -1
drivers/mtd/devices/sst25l.c
··· 180 180 mutex_lock(&flash->lock); 181 181 182 182 err = sst25l_wait_till_ready(flash); 183 - if (err) 183 + if (err) { 184 + mutex_unlock(&flash->lock); 184 185 return err; 186 + } 185 187 186 188 while (addr < end) { 187 189 err = sst25l_erase_sector(flash, addr);