Skip to content

Commit b9ce798

Browse files
elfringsmfrench
authored andcommitted
smb: client: Return a status code only as a constant in sid_to_id()
Return a status code without storing it in an intermediate variable. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 3a86608 commit b9ce798

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

fs/smb/client/cifsacl.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ int
339339
sid_to_id(struct cifs_sb_info *cifs_sb, struct smb_sid *psid,
340340
struct cifs_fattr *fattr, uint sidtype)
341341
{
342-
int rc = 0;
343342
struct key *sidkey;
344343
char *sidstr;
345344
const struct cred *saved_cred;
@@ -446,12 +445,12 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct smb_sid *psid,
446445
* fails then we just fall back to using the ctx->linux_uid/linux_gid.
447446
*/
448447
got_valid_id:
449-
rc = 0;
450448
if (sidtype == SIDOWNER)
451449
fattr->cf_uid = fuid;
452450
else
453451
fattr->cf_gid = fgid;
454-
return rc;
452+
453+
return 0;
455454
}
456455

457456
int

0 commit comments

Comments
 (0)