summaryrefslogtreecommitdiff
path: root/drivers/mtd/devices
diff options
context:
space:
mode:
authorChen Gong <g.chen@freescale.com>2008-06-05 13:50:04 (GMT)
committerDavid Woodhouse <dwmw2@infradead.org>2008-06-06 09:36:21 (GMT)
commitbc01886352c277e310c07befadbb617c8f561b89 (patch)
treec4f01d41e1705f1beb43ab6c1f3f34a1147c1c3e /drivers/mtd/devices
parentba75321193900a236bc5bbc29145e1039f74eb1b (diff)
downloadlinux-bc01886352c277e310c07befadbb617c8f561b89.tar.xz
[MTD] m25p80.c mutex unlock fix
fix a mutex release bug in function m25p80_write. Signed-off-by: Chen Gong <g.chen@freescale.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r--drivers/mtd/devices/m25p80.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 25efd33..b402269 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -346,8 +346,10 @@ static int m25p80_write(struct mtd_info *mtd, loff_t to, size_t len,
mutex_lock(&flash->lock);
/* Wait until finished previous write command. */
- if (wait_till_ready(flash))
+ if (wait_till_ready(flash)) {
+ mutex_unlock(&flash->lock);
return 1;
+ }
write_enable(flash);