fs/cifs: fix gcc warning in sid_to_id
authorQiujun Huang <hqjagain@gmail.com>
Wed, 4 Mar 2020 07:42:51 +0000 (15:42 +0800)
committerSteve French <stfrench@microsoft.com>
Mon, 23 Mar 2020 03:49:09 +0000 (22:49 -0500)
fix warning [-Wunused-but-set-variable] at variable 'rc',
keeping the code readable.

Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsacl.c

index 716574aab3b6a88c823a1511569511bb6491a94a..ae421634aa42895c76e47f930c252e303db2a670 100644 (file)
@@ -342,7 +342,7 @@ static int
 sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
                struct cifs_fattr *fattr, uint sidtype)
 {
-       int rc;
+       int rc = 0;
        struct key *sidkey;
        char *sidstr;
        const struct cred *saved_cred;
@@ -450,11 +450,12 @@ out_revert_creds:
         * fails then we just fall back to using the mnt_uid/mnt_gid.
         */
 got_valid_id:
+       rc = 0;
        if (sidtype == SIDOWNER)
                fattr->cf_uid = fuid;
        else
                fattr->cf_gid = fgid;
-       return 0;
+       return rc;
 }
 
 int