Skip to content

Commit f2d6793

Browse files
Qiujun Huangsmfrench
authored andcommitted
fs/cifs: fix gcc warning in sid_to_id
fix warning [-Wunused-but-set-variable] at variable 'rc', keeping the code readable. Signed-off-by: Qiujun Huang <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 0667059 commit f2d6793

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/cifs/cifsacl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ static int
342342
sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
343343
struct cifs_fattr *fattr, uint sidtype)
344344
{
345-
int rc;
345+
int rc = 0;
346346
struct key *sidkey;
347347
char *sidstr;
348348
const struct cred *saved_cred;
@@ -450,11 +450,12 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
450450
* fails then we just fall back to using the mnt_uid/mnt_gid.
451451
*/
452452
got_valid_id:
453+
rc = 0;
453454
if (sidtype == SIDOWNER)
454455
fattr->cf_uid = fuid;
455456
else
456457
fattr->cf_gid = fgid;
457-
return 0;
458+
return rc;
458459
}
459460

460461
int

0 commit comments

Comments
 (0)