mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 14:41:39 +00:00
[MTD] Only call mtd->sync() method in mtdchar close if opened for write.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
parent
fd5324909e
commit
7eafaed55f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user