Skip to content

Commit

Permalink
[MTD] m25p80.c mutex unlock fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chen Gong authored and David Woodhouse committed Jun 6, 2008
1 parent ba75321 commit bc01886
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/mtd/devices/m25p80.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit bc01886

Please sign in to comment.