Patchwork [07/10] jffs2: init the ret with -EINVAL

login
register
mail settings
Submitter Huang Shijie
Date Aug. 12, 2013, 5:42 a.m.
Message ID <1376286173-12581-8-git-send-email-b32955@freescale.com>
Download mbox | patch
Permalink /patch/266429/
State New
Headers show

Comments

Huang Shijie - Aug. 12, 2013, 5:42 a.m.
If the media is not SLC nand, dataflash, Sibley flash or a
ubi volume, we should return -EINVAL to the caller.
The caller should exit in this case.

Current code returns 0 in this case which is not proper.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 fs/jffs2/fs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c
index fe3c052..0452445 100644
--- a/fs/jffs2/fs.c
+++ b/fs/jffs2/fs.c
@@ -702,7 +702,7 @@  void jffs2_gc_release_page(struct jffs2_sb_info *c,
 }
 
 static int jffs2_flash_setup(struct jffs2_sb_info *c) {
-	int ret = 0;
+	int ret = -EINVAL;
 
 	if (jffs2_cleanmarker_oob(c)) {
 		/* NAND flash... do setup accordingly */