* [PATCH 1/1] MTD: cfi chip, fix lock imbalance
@ 2009-12-10 13:23 Jiri Slaby
0 siblings, 0 replies; only message in thread
From: Jiri Slaby @ 2009-12-10 13:23 UTC (permalink / raw)
To: dwmw2; +Cc: linux-mtd, jirislaby, linux-kernel
Stanse found a double unlock in get_chip. get_chip is called with
chip->mutex held and caller is responsible for unlocking it too.
Do not unlock the lock in get_chip on a fail path. This would mean
a double unlock.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/mtd/chips/cfi_cmdset_0002.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index 1d49e18..f3600e8 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -569,7 +569,6 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
if (time_after(jiffies, timeo)) {
printk(KERN_ERR "Waiting for chip to be ready timed out.\n");
- spin_unlock(chip->mutex);
return -EIO;
}
spin_unlock(chip->mutex);
--
1.6.5.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-12-10 13:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-10 13:23 [PATCH 1/1] MTD: cfi chip, fix lock imbalance Jiri Slaby
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).