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>
This commit is contained in:
Steve French 2021-06-22 14:07:36 -05:00
parent 2438c0bd59
commit 4c4a525ae5

View file

@ -397,7 +397,6 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
saved_cred = override_creds(root_cred); saved_cred = override_creds(root_cred);
sidkey = request_key(&cifs_idmap_key_type, sidstr, ""); sidkey = request_key(&cifs_idmap_key_type, sidstr, "");
if (IS_ERR(sidkey)) { if (IS_ERR(sidkey)) {
rc = -EINVAL;
cifs_dbg(FYI, "%s: Can't map SID %s to a %cid\n", cifs_dbg(FYI, "%s: Can't map SID %s to a %cid\n",
__func__, sidstr, sidtype == SIDOWNER ? 'u' : 'g'); __func__, sidstr, sidtype == SIDOWNER ? 'u' : 'g');
goto out_revert_creds; goto out_revert_creds;
@ -410,7 +409,6 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
*/ */
BUILD_BUG_ON(sizeof(uid_t) != sizeof(gid_t)); BUILD_BUG_ON(sizeof(uid_t) != sizeof(gid_t));
if (sidkey->datalen != sizeof(uid_t)) { if (sidkey->datalen != sizeof(uid_t)) {
rc = -EIO;
cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu)\n", cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu)\n",
__func__, sidkey->datalen); __func__, sidkey->datalen);
key_invalidate(sidkey); key_invalidate(sidkey);