]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
CIFS: Remove pointless variable assignment in cifs_dfs_do_automount()
authorJesper Juhl <jj@chaosbits.net>
Sat, 22 Jan 2011 20:07:16 +0000 (21:07 +0100)
committerSteve French <sfrench@us.ibm.com>
Mon, 24 Jan 2011 03:32:01 +0000 (03:32 +0000)
In fs/cifs/cifs_dfs_ref.c::cifs_dfs_do_automount() we have this code:

...
mnt = ERR_PTR(-EINVAL);
if (IS_ERR(tlink)) {
mnt = ERR_CAST(tlink);
goto free_full_path;
}
ses = tlink_tcon(tlink)->ses;

rc = get_dfs_path(xid, ses, full_path + 1, cifs_sb->local_nls,
&num_referrals, &referrals,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);

cifs_put_tlink(tlink);

mnt = ERR_PTR(-ENOENT);
...

The assignment of 'mnt = ERR_PTR(-EINVAL);' is completely pointless. If we
take the 'if (IS_ERR(tlink))' branch we'll set 'mnt' again and we'll also
do so if we do not take the branch. There is no way we'll ever use 'mnt'
with the assigned 'ERR_PTR(-EINVAL)' value, so we may as well just remove
the pointless assignment.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifs_dfs_ref.c

index 7ed36536e7540171cd2bcca9f20b79555a5f73d8..f1c68629f2770a44434e1fa9895a532d7a65c419 100644 (file)
@@ -297,7 +297,6 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
 
        cifs_sb = CIFS_SB(mntpt->d_inode->i_sb);
        tlink = cifs_sb_tlink(cifs_sb);
-       mnt = ERR_PTR(-EINVAL);
        if (IS_ERR(tlink)) {
                mnt = ERR_CAST(tlink);
                goto free_full_path;