Project

General

Profile

Bug #10441

hxge: NULL pointer errors

Added by Toomas Soome 5 months ago. Updated 5 months ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

NULL pointer errors:

    In file included from ../../common/io/hxge/hpi.h:36:0,
                     from ../../common/io/hxge/hpi_vmac.h:33,
                     from ../../common/io/hxge/hxge_vmac.h:36,
                     from ../../common/io/hxge/hxge_impl.h:66,
                     from ../../common/io/hxge/hxge_pfc.c:27:
    ../../common/io/hxge/hxge_pfc.c: In function 'hxge_classify_init_sw':
    ../../common/sys/null.h:32:14: error: passing argument 2 of 'kmem_zalloc' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_common_impl.h:133:52: note: in definition of macro 'KMEM_ZALLOC'
     #define KMEM_ZALLOC(size, flag)  kmem_zalloc(size, flag)
                                                        ^~~~
    ../../common/io/hxge/hxge_pfc.c:1020:55: note: in expansion of macro 'NULL'
      classify_ptr->tcam_entries = KMEM_ZALLOC(alloc_size, NULL);
                                                           ^~~~
    In file included from ../../common/sys/rctl.h:28:0,
                     from ../../common/sys/proc.h:47,
                     from ../../common/sys/systm.h:40,
                     from ../../common/sys/conf.h:56,
                     from ../../common/sys/stropts.h:38,
                     from ../../common/io/hxge/hxge_impl.h:37,
                     from ../../common/io/hxge/hxge_pfc.c:27:
    ../../common/sys/kmem.h:59:14: note: expected 'int' but argument is of type 'void *'
     extern void *kmem_zalloc(size_t size, int kmflags);
                  ^~~~~~~~~~~
    ../../common/io/hxge/hxge_pfc.c: In function 'hxge_classify_exit_sw':
    ../../common/io/hxge/hxge_pfc.c:1047:26: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      hxgep->classifier.state = NULL;
                              ^

    In file included from ../../common/sys/param.h:48:0,
                     from ../../common/sys/t_lock.h:38,
                     from ../../common/sys/conf.h:37,
                     from ../../common/sys/stropts.h:38,
                     from ../../common/io/hxge/hxge_impl.h:37,
                     from ../../common/io/hxge/hxge_kstats.c:26:
    ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_kstats.c:105:17: note: in expansion of macro 'NULL'
      {RDC_STAT_END, NULL, NULL}
                     ^~~~
    ../../common/sys/null.h:32:14: note: (near initialization for 'hxge_rdc_stats[22].type')
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_kstats.c:105:17: note: in expansion of macro 'NULL'
      {RDC_STAT_END, NULL, NULL}
                     ^~~~
    ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_kstats.c:121:21: note: in expansion of macro 'NULL'
      {RDC_SYS_STAT_END, NULL, NULL}
                         ^~~~
    ../../common/sys/null.h:32:14: note: (near initialization for 'hxge_rdc_sys_stats[4].type')
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_kstats.c:121:21: note: in expansion of macro 'NULL'
      {RDC_SYS_STAT_END, NULL, NULL}
                         ^~~~
    ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_kstats.c:187:17: note: in expansion of macro 'NULL'
      {TDC_STAT_END, NULL, NULL}
                     ^~~~
    ../../common/sys/null.h:32:14: note: (near initialization for 'hxge_tdc_stats[27].type')
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_kstats.c:187:17: note: in expansion of macro 'NULL'
      {TDC_STAT_END, NULL, NULL}
                     ^~~~
    ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_kstats.c:201:21: note: in expansion of macro 'NULL'
      {TDC_SYS_STAT_END, NULL, NULL}
                         ^~~~
    ../../common/sys/null.h:32:14: note: (near initialization for 'hxge_tdc_sys_stats[3].type')
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_kstats.c:201:21: note: in expansion of macro 'NULL'
      {TDC_SYS_STAT_END, NULL, NULL}
                         ^~~~
    ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_kstats.c:233:18: note: in expansion of macro 'NULL'
      {VMAC_STAT_END, NULL, NULL}
                      ^~~~
    ../../common/sys/null.h:32:14: note: (near initialization for 'hxge_vmac_stats[10].type')
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_kstats.c:233:18: note: in expansion of macro 'NULL'
      {VMAC_STAT_END, NULL, NULL}
                      ^~~~
    ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_kstats.c:262:17: note: in expansion of macro 'NULL'
      {PFC_STAT_END, NULL, NULL}
                     ^~~~
    ../../common/sys/null.h:32:14: note: (near initialization for 'hxge_pfc_stats[10].type')
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_kstats.c:262:17: note: in expansion of macro 'NULL'
      {PFC_STAT_END, NULL, NULL}
                     ^~~~
    ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_kstats.c:300:21: note: in expansion of macro 'NULL'
      {TDC_SYS_STAT_END, NULL, NULL}
                         ^~~~
    ../../common/sys/null.h:32:14: note: (near initialization for 'hxge_peu_sys_stats[15].type')
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_kstats.c:300:21: note: in expansion of macro 'NULL'
      {TDC_SYS_STAT_END, NULL, NULL}
                         ^~~~
    ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_kstats.c:344:19: note: in expansion of macro 'NULL'
      {MMAC_STATS_END, NULL, NULL},
                       ^~~~
    ../../common/sys/null.h:32:14: note: (near initialization for 'hxge_mmac_stats[18].type')
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_kstats.c:344:19: note: in expansion of macro 'NULL'
      {MMAC_STATS_END, NULL, NULL},
                       ^~~~

    In file included from ../../common/io/hxge/hpi.h:36:0,
                     from ../../common/io/hxge/hpi_vmac.h:33,
                     from ../../common/io/hxge/hxge_vmac.h:36,
                     from ../../common/io/hxge/hxge_impl.h:66,
                     from ../../common/io/hxge/hxge_hw.c:26:
    ../../common/io/hxge/hxge_hw.c: In function 'hxge_peu_handle_sys_errors':
    ../../common/sys/null.h:32:14: error: passing argument 2 of 'hxge_fm_report_error' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_common_impl.h:231:31: note: in definition of macro 'HXGE_FM_REPORT_ERROR'
       hxge_fm_report_error(hxgep, chan, ereport_id)
                                   ^~~~
    ../../common/io/hxge/hxge_hw.c:333:30: note: in expansion of macro 'NULL'
      HXGE_FM_REPORT_ERROR(hxgep, NULL, HXGE_FM_EREPORT_PEU_ERR);
                                  ^~~~
    In file included from ../../common/io/hxge/hxge_hw.c:26:0:
    ../../common/io/hxge/hxge_impl.h:344:13: note: expected 'uint8_t {aka unsigned char}' but argument is of type 'void *'
     extern void hxge_fm_report_error(p_hxge_t hxgep,
                 ^~~~~~~~~~~~~~~~~~~~
    In file included from ../../common/io/hxge/hpi.h:36:0,
                     from ../../common/io/hxge/hpi_vmac.h:33,
                     from ../../common/io/hxge/hxge_vmac.h:36,
                     from ../../common/io/hxge/hxge_impl.h:66,
                     from ../../common/io/hxge/hxge_hw.c:26:
    ../../common/io/hxge/hxge_hw.c: In function 'hxge_syserr_intr':
    ../../common/sys/null.h:32:14: error: passing argument 2 of 'hxge_fm_report_error' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_common_impl.h:231:31: note: in definition of macro 'HXGE_FM_REPORT_ERROR'
       hxge_fm_report_error(hxgep, chan, ereport_id)
                                   ^~~~
    ../../common/io/hxge/hxge_hw.c:399:32: note: in expansion of macro 'NULL'
        HXGE_FM_REPORT_ERROR(hxgep, NULL,
                                    ^~~~
    In file included from ../../common/io/hxge/hxge_hw.c:26:0:
    ../../common/io/hxge/hxge_impl.h:344:13: note: expected 'uint8_t {aka unsigned char}' but argument is of type 'void *'
     extern void hxge_fm_report_error(p_hxge_t hxgep,
                 ^~~~~~~~~~~~~~~~~~~~
    In file included from ../../common/io/hxge/hpi.h:36:0,
                     from ../../common/io/hxge/hpi_vmac.h:33,
                     from ../../common/io/hxge/hxge_vmac.h:36,
                     from ../../common/io/hxge/hxge_impl.h:66,
                     from ../../common/io/hxge/hxge_hw.c:26:
    ../../common/sys/null.h:32:14: error: passing argument 2 of 'hxge_fm_report_error' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_common_impl.h:231:31: note: in definition of macro 'HXGE_FM_REPORT_ERROR'
       hxge_fm_report_error(hxgep, chan, ereport_id)
                                   ^~~~
    ../../common/io/hxge/hxge_hw.c:403:32: note: in expansion of macro 'NULL'
        HXGE_FM_REPORT_ERROR(hxgep, NULL,
                                    ^~~~
    In file included from ../../common/io/hxge/hxge_hw.c:26:0:
    ../../common/io/hxge/hxge_impl.h:344:13: note: expected 'uint8_t {aka unsigned char}' but argument is of type 'void *'
     extern void hxge_fm_report_error(p_hxge_t hxgep,
                 ^~~~~~~~~~~~~~~~~~~~

    In file included from ../../common/io/hxge/hpi.h:36:0,
                     from ../../common/io/hxge/hpi_vmac.h:33,
                     from ../../common/io/hxge/hxge_vmac.h:36,
                     from ../../common/io/hxge/hxge_impl.h:66,
                     from ../../common/io/hxge/hxge_rxdma.c:26:
    ../../common/io/hxge/hxge_rxdma.c: In function 'hxge_receive_packet':
    ../../common/sys/null.h:32:14: error: passing argument 2 of 'hxge_fm_report_error' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_common_impl.h:231:31: note: in definition of macro 'HXGE_FM_REPORT_ERROR'
       hxge_fm_report_error(hxgep, chan, ereport_id)
                                   ^~~~
    ../../common/io/hxge/hxge_rxdma.c:1903:31: note: in expansion of macro 'NULL'
       HXGE_FM_REPORT_ERROR(hxgep, NULL, HXGE_FM_EREPORT_RDMC_RCR_ERR);
                                   ^~~~
    In file included from ../../common/io/hxge/hxge_rxdma.c:26:0:
    ../../common/io/hxge/hxge_impl.h:344:13: note: expected 'uint8_t {aka unsigned char}' but argument is of type 'void *'
     extern void hxge_fm_report_error(p_hxge_t hxgep,
                 ^~~~~~~~~~~~~~~~~~~~
    In file included from ../../common/io/hxge/hpi.h:36:0,
                     from ../../common/io/hxge/hpi_vmac.h:33,
                     from ../../common/io/hxge/hxge_vmac.h:36,
                     from ../../common/io/hxge/hxge_impl.h:66,
                     from ../../common/io/hxge/hxge_rxdma.c:26:
    ../../common/io/hxge/hxge_rxdma.c: In function 'hxge_rxdma_handle_sys_errors':
    ../../common/sys/null.h:32:14: error: passing argument 2 of 'hxge_fm_report_error' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_common_impl.h:231:31: note: in definition of macro 'HXGE_FM_REPORT_ERROR'
       hxge_fm_report_error(hxgep, chan, ereport_id)
                                   ^~~~
    ../../common/io/hxge/hxge_rxdma.c:3538:31: note: in expansion of macro 'NULL'
       HXGE_FM_REPORT_ERROR(hxgep, NULL,
                                   ^~~~
    In file included from ../../common/io/hxge/hxge_rxdma.c:26:0:
    ../../common/io/hxge/hxge_impl.h:344:13: note: expected 'uint8_t {aka unsigned char}' but argument is of type 'void *'
     extern void hxge_fm_report_error(p_hxge_t hxgep,
                 ^~~~~~~~~~~~~~~~~~~~
    In file included from ../../common/io/hxge/hpi.h:36:0,
                     from ../../common/io/hxge/hpi_vmac.h:33,
                     from ../../common/io/hxge/hxge_vmac.h:36,
                     from ../../common/io/hxge/hxge_impl.h:66,
                     from ../../common/io/hxge/hxge_rxdma.c:26:
    ../../common/sys/null.h:32:14: error: passing argument 2 of 'hxge_fm_report_error' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_common_impl.h:231:31: note: in definition of macro 'HXGE_FM_REPORT_ERROR'
       hxge_fm_report_error(hxgep, chan, ereport_id)
                                   ^~~~
    ../../common/io/hxge/hxge_rxdma.c:3556:31: note: in expansion of macro 'NULL'
       HXGE_FM_REPORT_ERROR(hxgep, NULL,
                                   ^~~~
    In file included from ../../common/io/hxge/hxge_rxdma.c:26:0:
    ../../common/io/hxge/hxge_impl.h:344:13: note: expected 'uint8_t {aka unsigned char}' but argument is of type 'void *'
     extern void hxge_fm_report_error(p_hxge_t hxgep,
                 ^~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    In file included from ../../common/io/hxge/hpi.h:36:0,
                     from ../../common/io/hxge/hpi_vmac.h:33,
                     from ../../common/io/hxge/hxge_vmac.h:36,
                     from ../../common/io/hxge/hxge_impl.h:66,
                     from ../../common/io/hxge/hxge_txdma.c:26:
    ../../common/io/hxge/hxge_txdma.c: In function 'hxge_txdma_handle_sys_errors':
    ../../common/sys/null.h:32:14: error: passing argument 2 of 'hxge_fm_report_error' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_common_impl.h:231:31: note: in definition of macro 'HXGE_FM_REPORT_ERROR'
       hxge_fm_report_error(hxgep, chan, ereport_id)
                                   ^~~~
    ../../common/io/hxge/hxge_txdma.c:2687:31: note: in expansion of macro 'NULL'
       HXGE_FM_REPORT_ERROR(hxgep, NULL,
                                   ^~~~
    In file included from ../../common/io/hxge/hxge_txdma.c:26:0:
    ../../common/io/hxge/hxge_impl.h:344:13: note: expected 'uint8_t {aka unsigned char}' but argument is of type 'void *'
     extern void hxge_fm_report_error(p_hxge_t hxgep,
                 ^~~~~~~~~~~~~~~~~~~~
    In file included from ../../common/io/hxge/hpi.h:36:0,
                     from ../../common/io/hxge/hpi_vmac.h:33,
                     from ../../common/io/hxge/hxge_vmac.h:36,
                     from ../../common/io/hxge/hxge_impl.h:66,
                     from ../../common/io/hxge/hxge_txdma.c:26:
    ../../common/sys/null.h:32:14: error: passing argument 2 of 'hxge_fm_report_error' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/hxge/hxge_common_impl.h:231:31: note: in definition of macro 'HXGE_FM_REPORT_ERROR'
       hxge_fm_report_error(hxgep, chan, ereport_id)
                                   ^~~~
    ../../common/io/hxge/hxge_txdma.c:2696:31: note: in expansion of macro 'NULL'
       HXGE_FM_REPORT_ERROR(hxgep, NULL,
                                   ^~~~
    In file included from ../../common/io/hxge/hxge_txdma.c:26:0:
    ../../common/io/hxge/hxge_impl.h:344:13: note: expected 'uint8_t {aka unsigned char}' but argument is of type 'void *'
     extern void hxge_fm_report_error(p_hxge_t hxgep,
                 ^~~~~~~~~~~~~~~~~~~~

    ../../common/io/hxge/hxge_main.c: In function 'hxge_dma_mem_free':
    ../../common/io/hxge/hxge_main.c:2397:17: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      dma_p->alength = NULL;
                     ^
    cc1: all warnings being treated as errors

For hxge kstat, I did set the type value not 0, but the respective data type; the code does iterate over the array checking for name field not being NULL.

History

#1

Updated by Toomas Soome 5 months ago

  • Description updated (diff)
#2

Updated by Electric Monk 5 months ago

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

git commit c11cea93a9321bd25667986dc65a86b56de2ac04

commit  c11cea93a9321bd25667986dc65a86b56de2ac04
Author: Toomas Soome <tsoome@me.com>
Date:   2019-02-25T19:40:36.000Z

    10441 hxge: NULL pointer errors
    Reviewed by: Andy Fiddaman <andy@omniosce.org>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Gergő Doma <domag02@gmail.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF