From: Chen Gong Date: Thu, 5 Jun 2008 13:50:04 +0000 (+0800) Subject: [MTD] m25p80.c mutex unlock fix X-Git-Tag: v2.6.26-rc6~35^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc01886352c277e310c07befadbb617c8f561b89;p=linux-2.6 [MTD] m25p80.c mutex unlock fix fix a mutex release bug in function m25p80_write. Signed-off-by: Chen Gong Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 25efd331ef..b402269301 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);