diff mbox

[U-Boot,4/9] fat: apply upstream bugfix to ff.c

Message ID 1439003370-3671-5-git-send-email-swarren@wwwdotorg.org
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Stephen Warren Aug. 8, 2015, 3:09 a.m. UTC
This is a v0.11 post-release patch #1 (March 9, 2015) downloaded from:
http://elm-chan.org/fsw/ff/patches.html on 20150804.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
 fs/fat/ff.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox

Patch

diff --git a/fs/fat/ff.c b/fs/fat/ff.c
index 30d2e714c8d2..fe7764d6daa2 100644
--- a/fs/fat/ff.c
+++ b/fs/fat/ff.c
@@ -2329,14 +2329,11 @@  FRESULT validate (	/* FR_OK(0): The object is valid, !=0: Invalid */
 	FIL *fil = (FIL*)obj;	/* Assuming offset of .fs and .id in the FIL/DIR structure is identical */
 
 
-	if (!fil || !fil->fs || !fil->fs->fs_type || fil->fs->id != fil->id)
+	if (!fil || !fil->fs || !fil->fs->fs_type || fil->fs->id != fil->id || (disk_status(fil->fs->drv) & STA_NOINIT))
 		return FR_INVALID_OBJECT;
 
 	ENTER_FF(fil->fs);		/* Lock file system */
 
-	if (disk_status(fil->fs->drv) & STA_NOINIT)
-		return FR_NOT_READY;
-
 	return FR_OK;
 }