Project

General

Profile

Actions

Bug #10673

closed

ixgbe: NULL pointer errors

Added by Toomas Soome over 4 years ago. Updated over 4 years ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

Build errors with NULL pointer:

    ../../common/io/ixgbe/ixgbe_main.c: In function 'ixgbe_setup_rx_ring':
    ../../common/io/ixgbe/ixgbe_main.c:2365:22: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       rbd->read.hdr_addr = NULL;
                          ^

    ../../common/io/ixgbe/ixgbe_main.c: In function 'ixgbe_setup_rx_ring':
    ../../common/io/ixgbe/ixgbe_main.c:2365:22: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       rbd->read.hdr_addr = 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/io/ixgbe/ixgbe_sw.h:41,
                     from ../../common/io/ixgbe/ixgbe_main.c:35:
    ../../common/io/ixgbe/ixgbe_main.c: In function 'ixgbe_init_unicst':
    ../../common/sys/null.h:32:14: error: passing argument 4 of 'ixgbe_set_rar' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/ixgbe/ixgbe_main.c:3105:45: note: in expansion of macro 'NULL'
        (void) ixgbe_set_rar(hw, slot, mac_addr, NULL, NULL);
                                                 ^~~~
    In file included from ../../common/io/ixgbe/ixgbe_sw.h:77:0,
                     from ../../common/io/ixgbe/ixgbe_main.c:35:
    ../../common/io/ixgbe/core/ixgbe_api.h:110:5: note: expected 'u32 {aka unsigned int}' but argument is of type 'void *'
     s32 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
         ^~~~~~~~~~~~~
    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/io/ixgbe/ixgbe_sw.h:41,
                     from ../../common/io/ixgbe/ixgbe_main.c:35:
    ../../common/sys/null.h:32:14: error: passing argument 5 of 'ixgbe_set_rar' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/ixgbe/ixgbe_main.c:3105:51: note: in expansion of macro 'NULL'
        (void) ixgbe_set_rar(hw, slot, mac_addr, NULL, NULL);
                                                       ^~~~
    In file included from ../../common/io/ixgbe/ixgbe_sw.h:77:0,
                     from ../../common/io/ixgbe/ixgbe_main.c:35:
    ../../common/io/ixgbe/core/ixgbe_api.h:110:5: note: expected 'u32 {aka unsigned int}' but argument is of type 'void *'
     s32 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
         ^~~~~~~~~~~~~
    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/io/ixgbe/ixgbe_sw.h:41,
                     from ../../common/io/ixgbe/ixgbe_main.c:35:
    ../../common/sys/null.h:32:14: error: passing argument 4 of 'ixgbe_set_rar' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/ixgbe/ixgbe_main.c:3120:9: note: in expansion of macro 'NULL'
             NULL, NULL);
             ^~~~
    In file included from ../../common/io/ixgbe/ixgbe_sw.h:77:0,
                     from ../../common/io/ixgbe/ixgbe_main.c:35:
    ../../common/io/ixgbe/core/ixgbe_api.h:110:5: note: expected 'u32 {aka unsigned int}' but argument is of type 'void *'
     s32 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
         ^~~~~~~~~~~~~
    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/io/ixgbe/ixgbe_sw.h:41,
                     from ../../common/io/ixgbe/ixgbe_main.c:35:
    ../../common/sys/null.h:32:14: error: passing argument 5 of 'ixgbe_set_rar' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/ixgbe/ixgbe_main.c:3120:15: note: in expansion of macro 'NULL'
             NULL, NULL);
                   ^~~~
    In file included from ../../common/io/ixgbe/ixgbe_sw.h:77:0,
                     from ../../common/io/ixgbe/ixgbe_main.c:35:
    ../../common/io/ixgbe/core/ixgbe_api.h:110:5: note: expected 'u32 {aka unsigned int}' but argument is of type 'void *'
     s32 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
         ^~~~~~~~~~~~~

    ../../common/io/ixgbe/ixgbe_buf.c: In function 'ixgbe_alloc_tbd_ring':
    ../../common/io/ixgbe/ixgbe_buf.c:386:33: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       tx_ring->tbd_area.dma_address = NULL;
                                     ^
    ../../common/io/ixgbe/ixgbe_buf.c: In function 'ixgbe_free_tbd_ring':
    ../../common/io/ixgbe/ixgbe_buf.c:428:32: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      tx_ring->tbd_area.dma_address = NULL;
                                    ^
    ../../common/io/ixgbe/ixgbe_buf.c: In function 'ixgbe_alloc_rbd_ring':
    ../../common/io/ixgbe/ixgbe_buf.c:505:33: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       rx_data->rbd_area.dma_address = NULL;
                                     ^
    ../../common/io/ixgbe/ixgbe_buf.c: In function 'ixgbe_free_rbd_ring':
    ../../common/io/ixgbe/ixgbe_buf.c:547:32: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      rx_data->rbd_area.dma_address = NULL;
                                    ^
    ../../common/io/ixgbe/ixgbe_buf.c: In function 'ixgbe_alloc_dma_buffer':
    ../../common/io/ixgbe/ixgbe_buf.c:599:20: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       buf->dma_address = NULL;
                        ^
    ../../common/io/ixgbe/ixgbe_buf.c: In function 'ixgbe_free_dma_buffer':
    ../../common/io/ixgbe/ixgbe_buf.c:631:20: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       buf->dma_address = 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/io/ixgbe/ixgbe_sw.h:41,
                     from ../../common/io/ixgbe/ixgbe_tx.c:33:
    ../../common/io/ixgbe/ixgbe_tx.c: In function 'ixgbe_ring_tx':
    ../../common/sys/null.h:32:14: error: passing argument 2 of 'allocb' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/ixgbe/ixgbe_tx.c:223:38: note: in expansion of macro 'NULL'
        hdr_new_mp = allocb(hdr_frag_len, NULL);
                                          ^~~~
    In file included from ../../common/io/ixgbe/ixgbe_sw.h:44:0,
                     from ../../common/io/ixgbe/ixgbe_tx.c:33:
    ../../common/sys/stream.h:782:16: note: expected 'uint_t {aka unsigned int}' but argument is of type 'void *'
     extern mblk_t *allocb(size_t, uint_t);
                    ^~~~~~
    cc1: all warnings being treated as errors

Actions #1

Updated by Electric Monk over 4 years ago

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

git commit afac708dc1fa673063127e6091e0f29b33739e9e

commit  afac708dc1fa673063127e6091e0f29b33739e9e
Author: Toomas Soome <tsoome@me.com>
Date:   2019-04-10T06:33:20.000Z

    10673 ixgbe: NULL pointer errors
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Gergő Doma <domag02@gmail.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF