Project

General

Profile

Bug #12654

nxge: smatch and NULL pointer errors

Added by Toomas Soome 3 months ago. Updated 18 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
driver - device drivers
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors on SPARC with NULL pointers:

    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/nxge_hw.c:220 nxge_intr() warn: variable dereferenced before check 'ldvp' (see line 208)

    ../../common/io/nxge/nxge_hio_guest.c: In function 'nxge_hio_vr_release':
    ../../common/io/nxge/nxge_hio_guest.c:575: error: assignment makes integer from pointer without a cast

    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/nxge_ipp.c:769 nxge_ipp_eccue_valid_check() warn: variable dereferenced before check 'valid' (see line 735)

    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/nxge_rxdma.c:3059 nxge_rx_err_evnts() warn: if statement not indented

    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/npi/npi_fflp.c:653 npi_fflp_fcram_entry_write() warn: inconsistent indenting
    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/npi/npi_fflp.c:721 npi_fflp_fcram_entry_read() warn: inconsistent indenting
    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/npi/npi_fflp.c:733 npi_fflp_fcram_entry_read() warn: inconsistent indenting
    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/npi/npi_fflp.c:747 npi_fflp_fcram_entry_read() warn: inconsistent indenting
    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/npi/npi_fflp.c:974 npi_fflp_cfg_fcram_partition() warn: inconsistent indenting
    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/npi/npi_fflp.c:1575 npi_fflp_cfg_enet_vlan_table_assoc() warn: inconsistent indenting

    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/nxge_virtual.c:2852 nxge_set_hw_vlan_class_config() warn: always true condition '(vmap->map_to >= 0) => (0-255 >= 0)'
    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/nxge_virtual.c:2914 nxge_set_hw_mac_class_config() warn: always true condition '(mac_map->map_to >= 0) => (0-255 >= 0)'

    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/nxge_send.c:1225 nxge_lso_info_get() warn: variable dereferenced before check 'mss' (see line 1222)

    ../../common/io/nxge/nxge_main.c: In function 'nxge_dma_mem_alloc':
    ../../common/io/nxge/nxge_main.c:3529: error: assignment makes integer from pointer without a cast
    ../../common/io/nxge/nxge_main.c:3536: error: comparison between pointer and integer
    ../../common/io/nxge/nxge_main.c: In function 'nxge_dma_mem_free':
    ../../common/io/nxge/nxge_main.c:3649: error: assignment makes integer from pointer without a cast
    ../../common/io/nxge/nxge_main.c: In function 'nxge_dma_free_rx_data_buf':
    ../../common/io/nxge/nxge_main.c:3710: error: assignment makes integer from pointer without a cast
    ../../common/io/nxge/nxge_main.c:3714: error: assignment makes integer from pointer without a cast

    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/nxge_mac.c:1540 nxge_n2_serdes_init() warn: if statement not indented
    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/nxge_mac.c:2005 nxge_n2_kt_serdes_init() warn: inconsistent indenting
    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/nxge_mac.c:2034 nxge_n2_kt_serdes_init() warn: inconsistent indenting
    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/nxge_mac.c:2522 nxge_1G_serdes_init() warn: inconsistent indenting
    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/nxge_mac.c:2536 nxge_1G_serdes_init() warn: inconsistent indenting
    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/nxge_mac.c:4640 nxge_rx_mac_reset() warn: if statement not indented
    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/nxge_mac.c:4644 nxge_rx_mac_reset() warn: if statement not indented
    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/nxge_mac.c:7130 nxge_mac_intr() warn: curly braces intended?
    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/nxge_mac.c:7133 nxge_mac_intr() warn: inconsistent indenting
    /code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: ../../common/io/nxge/nxge_mac.c:7518 nxge_hswap_phy_present() warn: inconsistent indenting

Testing done: build/install/boot

History

#1

Updated by Toomas Soome 28 days ago

  • Description updated (diff)
#2

Updated by Electric Monk 19 days ago

  • Gerrit CR set to 628
#3

Updated by Electric Monk 18 days ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 4df3b64db8cae3f054ccdd573395ba7807bcd868

commit  4df3b64db8cae3f054ccdd573395ba7807bcd868
Author: Toomas Soome <tsoome@me.com>
Date:   2020-06-26T13:30:23.000Z

    12654 nxge: smatch and NULL pointer errors
    Reviewed by: Michael Speer <michael.speer@pluribusnetworks.com>
    Reviewed by: Yuri Pankov <ypankov@tintri.com>
    Reviewed by: Igor Kozhukhov <igor@dilos.org>
    Reviewed by: Vitaliy Gusev <gusev.vitaliy@icloud.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF