re: cifs: change smb2_query_eas to use the compound query-info helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Static analysis by CoverityScan found a potential issue in the following
commit:

commit 9c050310b83500e0d02e41c4c5fbc8e1662945d5
Author: Ronnie Sahlberg <lsahlber@xxxxxxxxxx>
Date:   Thu Nov 15 08:40:19 2018 +1000

    cifs: change smb2_query_eas to use the compound query-info helper


CoverityScan reported the issue as follows:

 856        rc = smb2_validate_iov(le16_to_cpu(rsp->OutputBufferOffset),
 857                               le32_to_cpu(rsp->OutputBufferLength),
 858                               &rsp_iov,
 859                               sizeof(struct smb2_file_full_ea_info));

   cond_const: Condition rc, taking false branch. Now the value of rc is
equal to 0.

 860        if (rc)
 861                goto qeas_exit;
 862
 863        /*
 864         * If ea_name is NULL (listxattr) and there are no EAs,
return 0 as it's
 865         * not an error. Otherwise, the specified ea_name was not found.
 866         */
 866         */

    const: At condition rc, the value of rc must be equal to 0.
    dead_error_condition: The condition !rc must be true.

 867        if (!rc) {
 868                info = (struct smb2_file_full_ea_info *)(
 869                        le16_to_cpu(rsp->OutputBufferOffset) + (char
*)rsp);
 870                rc = move_smb2_ea_to_cifs(ea_data, buf_size, info,
 871                        le32_to_cpu(rsp->OutputBufferLength), ea_name);

    CID undefined (#1 of 1): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement: if (!ea_name &&
rc == -61)

....

 872        } else if (!ea_name && rc == -ENODATA)
 873                rc = 0;
 874

so it appears because of the check on rc at line 860 we can never reach
the point where rc == -ENODATA.  I'm not clear what the original
intention was, hence I'm reporting this issue.

Colin



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux