Commit 7eafaed5 authored by Joakim Tjernlund's avatar Joakim Tjernlund Committed by David Woodhouse

[MTD] Only call mtd->sync() method in mtdchar close if opened for write.

Signed-off-by: default avatarJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent fd532490
......@@ -135,7 +135,8 @@ static int mtd_close(struct inode *inode, struct file *file)
DEBUG(MTD_DEBUG_LEVEL0, "MTD_close\n");
if (mtd->sync)
/* Only sync if opened RW */
if ((file->f_mode & 2) && mtd->sync)
mtd->sync(mtd);
put_mtd_device(mtd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment