Browse Source

[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>
Chen Gong 17 years ago
parent
commit
bc01886352
1 changed files with 3 additions and 1 deletions
  1. 3 1
      drivers/mtd/devices/m25p80.c

+ 3 - 1
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);
 	mutex_lock(&flash->lock);
 
 
 	/* Wait until finished previous write command. */
 	/* Wait until finished previous write command. */
-	if (wait_till_ready(flash))
+	if (wait_till_ready(flash)) {
+		mutex_unlock(&flash->lock);
 		return 1;
 		return 1;
+	}
 
 
 	write_enable(flash);
 	write_enable(flash);