Skip to content

Commit 4c4a525

Browse files
committed
cifs: remove two cases where rc is set unnecessarily in sid_to_id
In both these cases sid_to_id unconditionally returned success, and used the default uid/gid for the mount, so setting rc is confusing and simply gets overwritten (set to 0) later in the function. Addresses-Coverity: 1491672 ("Unused value") Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 2438c0b commit 4c4a525

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

fs/cifs/cifsacl.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,6 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
397397
saved_cred = override_creds(root_cred);
398398
sidkey = request_key(&cifs_idmap_key_type, sidstr, "");
399399
if (IS_ERR(sidkey)) {
400-
rc = -EINVAL;
401400
cifs_dbg(FYI, "%s: Can't map SID %s to a %cid\n",
402401
__func__, sidstr, sidtype == SIDOWNER ? 'u' : 'g');
403402
goto out_revert_creds;
@@ -410,7 +409,6 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
410409
*/
411410
BUILD_BUG_ON(sizeof(uid_t) != sizeof(gid_t));
412411
if (sidkey->datalen != sizeof(uid_t)) {
413-
rc = -EIO;
414412
cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu)\n",
415413
__func__, sidkey->datalen);
416414
key_invalidate(sidkey);

0 commit comments

Comments
 (0)