Project

General

Profile

Bug #12417

emlxs: variable may be used uninitialized

Added by Toomas Soome 4 months ago. Updated 20 days ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
-
Start date:
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with gcc 9:

    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c: In function 'emlxs_dhc_state':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c:411:11: error: 'pstate' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      411 |  uint32_t pstate;
          |           ^~~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c: In function 'emlxs_issue_auth_negotiate':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c:1733:25: error: 'ap2' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1733 |    ap2->params.name_tag = AUTH_NAME_ID;
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c:1833:35: error: 'null_ap2' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1833 |    null_ap2->params.DHgIDList_tag = DHGID_LIST_TAG;
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c:1810:35: error: 'null_ap1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1810 |    null_ap1->params.DHgIDList_tag = DHGID_LIST_TAG;
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c: In function 'emlxs_rcv_auth_msg_unmapped_node':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c:4703:10: error: 'ReasonCodeExplanation' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4703 |  uint8_t ReasonCodeExplanation;
          |          ^~~~~~~~~~~~~~~~~~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c:4702:10: error: 'ReasonCode' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4702 |  uint8_t ReasonCode;
          |          ^~~~~~~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c: In function 'emlxs_hash_vrf':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c:5026:12: error: 'hash_val' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5026 |  uint32_t *hash_val;
          |            ^~~~~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c: In function 'emlxs_hash_rsp':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c:5238:12: error: 'hash_val' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5238 |  uint32_t *hash_val;
          |            ^~~~~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c: In function 'emlxs_BIGNUM_get_pubkey':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c:5640:6: error: 'plen' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5640 |  if (big_init(&n, CHARLEN2BIGNUMLEN(plen)) != BIG_OK) {
          |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c: In function 'emlxs_BIGNUM_get_dhval':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c:5856:6: error: 'plen' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5856 |  if (big_init(&n, CHARLEN2BIGNUMLEN(plen)) != BIG_OK) {
          |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c: In function 'emlxs_BIGNUM_pubkey':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c:5991:6: error: 'plen' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5991 |  if (big_init(&n, CHARLEN2BIGNUMLEN(plen)) != BIG_OK) {
          |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c: In function 'emlxs_auth_cfg_parse':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c:8098:8: error: 'sum' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     8098 |    sum |= (c1 - '0');
          |    ~~~~^~~~~~~~~~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c: In function 'emlxs_auth_key_parse':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c:8749:8: error: 'sum' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     8749 |    sum |= (c1 - '0');
          |    ~~~~^~~~~~~~~~~~~

    ../../common/io/fibre-channel/fca/emlxs/emlxs_ip.c: In function 'emlxs_ip_handle_rcv_seq_list':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_ip.c:359:3: error: 'hbq_id' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      359 |   emlxs_update_HBQ_index(hba, hbq_id);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    In file included from ../..//common/sys/fibre-channel/fca/emlxs/emlxs.h:44,
                     from ../../common/io/fibre-channel/fca/emlxs/emlxs_fcp.c:27:
    ../../common/io/fibre-channel/fca/emlxs/emlxs_fcp.c: In function 'emlxs_handle_fcp_event':
    ../..//common/sys/fibre-channel/fca/emlxs/emlxs_msg.h:63:21: error: 'scsi_dl' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       63 | #define EMLXS_MSGF  emlxs_msg_printf
          |                     ^~~~~~~~~~~~~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_fcp.c:74:11: note: 'scsi_dl' was declared here
       74 |  uint16_t scsi_dl;
          |           ^~~~~~~

    ../../common/io/fibre-channel/fca/emlxs/emlxs_dfc.c: In function 'emlxs_dfc_create_vport':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dfc.c:2916:16: error: 'vport' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2916 |  emlxs_port_t *vport;
          |                ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_dfc.c:3039:24: error: 'vpi' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     3039 |   dfc_vport->wwnn[1] = (uint8_t)vpi;
          |                        ^~~~~~~~~~~~

    In file included from ../..//common/sys/fibre-channel/fca/emlxs/emlxs.h:36,
                     from ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:27:
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c: In function 'emlxs_sli3_issue_mbox_cmd':
    ../..//common/sys/fibre-channel/fca/emlxs/emlxs_os.h:403:10: error: 'offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      403 |   (void) ddi_dma_sync((ddi_dma_handle_t)(h), \
          |          ^~~~~~~~~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:3157:10: note: 'offset' was declared here
     3157 |  off_t   offset;
          |          ^~~~~~
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk 20 days ago

  • Gerrit CR set to 436

Also available in: Atom PDF