Skip to contentSkip to conversation

fs/jfs: Fix missing error code in lmLogInit()

PATCH In review Jiapeng Chong 2 participants 2 messages Jun 1, 2021 JFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/jfs: Fix missing error code in lmLogInit()

The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'rc.

Eliminate the follow smatch warning:

fs/jfs/jfs_logmgr.c:1327 lmLogInit() warn: missing error code 'rc'.

---
 fs/jfs/jfs_logmgr.c | 1 +
 1 file changed, 1 insertion(+)
fs/jfs/jfs_logmgr.c +1 -0
index 9330eff21..78fd136 100644
@@ -1324,6 +1324,7 @@ int lmLogInit(struct jfs_log * log)
 		} else {
 			if (!uuid_equal(&logsuper->uuid, &log->uuid)) {
 				jfs_warn("wrong uuid on JFS log device");
+				rc = -EINVAL;
 				goto errout20;
 			}
 			log->size = le32_to_cpu(logsuper->size);
Signature · 1 line
1.8.3.1
#1 lore raw

Good catch. I'll push this in the next merge window.

Thanks,
Shaggy

Quoted 26 lines · Jiapeng Chong

The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'rc.

Eliminate the follow smatch warning:

fs/jfs/jfs_logmgr.c:1327 lmLogInit() warn: missing error code 'rc'.

---
  fs/jfs/jfs_logmgr.c | 1 +
  1 file changed, 1 insertion(+)
fs/jfs/jfs_logmgr.c +1 -0
index 9330eff21..78fd136 100644
@@ -1324,6 +1324,7 @@ int lmLogInit(struct jfs_log * log)
  		} else {
  			if (!uuid_equal(&logsuper->uuid, &log->uuid)) {
  				jfs_warn("wrong uuid on JFS log device");
+				rc = -EINVAL;
  				goto errout20;
  			}
  			log->size = le32_to_cpu(logsuper->size);