Skip to contentSkip to conversation

staging: exfat: remove return and error return via a goto

PATCH New Colin King 1 participant 1 message Sep 2, 2019

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH v2 1/1 staging: exfat: remove return and error return via a goto

From: Colin Ian King <[email protected]>

The return statement is incorrect, the error exit should be by assigning ret with the error code and exiting via label out. Thanks to Valdis Klētnieks for correcting my original fix.

Addresses-Coverity: ("Structurally dead code")

---

V2: exit via the got rather than returning via the return statement

---
 drivers/staging/exfat/exfat_super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/exfat/exfat_super.c +1 -1
index 5b5c2ca8c9aa..8c2130cc431b 100644
@@ -664,7 +664,7 @@ static int ffsLookupFile(struct inode *inode, char *path, struct file_id_t *fid)
 	dentry = p_fs->fs_func->find_dir_entry(sb, &dir, &uni_name, num_entries,
 					       &dos_name, TYPE_ALL);
 	if (dentry < -1) {
-		return FFS_NOTFOUND;
+		ret = FFS_NOTFOUND;
 		goto out;
 	}
 
Signature · 1 line
2.20.1