Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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

parent fd532490
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -135,7 +135,8 @@ static int mtd_close(struct inode *inode, struct file *file)


	DEBUG(MTD_DEBUG_LEVEL0, "MTD_close\n");
	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);
		mtd->sync(mtd);


	put_mtd_device(mtd);
	put_mtd_device(mtd);