From: Chen Gong Date: Thu, 5 Jun 2008 13:50:04 +0000 (+0800) Subject: [MTD] m25p80.c mutex unlock fix X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bc01886352c277e310c07befadbb617c8f561b89;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [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 25efd331ef28..b402269301f6 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);