Blob Blame History Raw
From: Steve French <stfrench@microsoft.com>
Date: Sat, 19 Jun 2021 15:53:18 -0500
Subject: [PATCH] cifs: fix SMB1 error path in cifs_get_file_info_unix
Git-commit: e39df24169a2ceb0d359eb3a05ff982711f2eb32
References: bsc#1190317
Patch-mainline: v5.13

We were trying to fill in uninitialized file attributes in the error case.

Addresses-Coverity: 139689 ("Uninitialized variables")
Signed-off-by: Steve French <stfrench@microsoft.com>
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
---
 fs/cifs/inode.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -356,9 +356,12 @@ cifs_get_file_info_unix(struct file *fil
 	} else if (rc == -EREMOTE) {
 		cifs_create_dfs_fattr(&fattr, inode->i_sb);
 		rc = 0;
-	}
+	} else
+		goto cifs_gfiunix_out;
 
 	cifs_fattr_to_inode(inode, &fattr);
+
+cifs_gfiunix_out:
 	free_xid(xid);
 	return rc;
 }