Project

General

Profile

Actions

Bug #10672

closed

igb: NULL pointer issues

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:

    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/igb/igb_sw.h:40,
                     from ../../common/io/igb/igb_tx.c:30:
    ../../common/io/igb/igb_tx.c: In function 'igb_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/igb/igb_tx.c:221:38: note: in expansion of macro 'NULL'
        hdr_new_mp = allocb(hdr_frag_len, NULL);
                                          ^~~~
    In file included from ../../common/io/igb/igb_sw.h:43:0,
                     from ../../common/io/igb/igb_tx.c:30:
    ../../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);
                    ^~~~~~

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

    ../../common/io/igb/igb_buf.c: In function 'igb_alloc_tbd_ring':
    ../../common/io/igb/igb_buf.c:281:33: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       tx_ring->tbd_area.dma_address = NULL;
                                     ^
    ../../common/io/igb/igb_buf.c: In function 'igb_free_tbd_ring':
    ../../common/io/igb/igb_buf.c:323:32: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      tx_ring->tbd_area.dma_address = NULL;
                                    ^
    ../../common/io/igb/igb_buf.c: In function 'igb_alloc_rbd_ring':
    ../../common/io/igb/igb_buf.c:509:33: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       rx_data->rbd_area.dma_address = NULL;
                                     ^
    ../../common/io/igb/igb_buf.c: In function 'igb_free_rbd_ring':
    ../../common/io/igb/igb_buf.c:551:32: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      rx_data->rbd_area.dma_address = NULL;
                                    ^
    ../../common/io/igb/igb_buf.c: In function 'igb_alloc_dma_buffer':
    ../../common/io/igb/igb_buf.c:605:20: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       buf->dma_address = NULL;
                        ^
    ../../common/io/igb/igb_buf.c: In function 'igb_free_dma_buffer':
    ../../common/io/igb/igb_buf.c:637:20: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       buf->dma_address = NULL;
                        ^
    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 d5f5d51371113b7fe3bc52690ff232a5b6719bfd

commit  d5f5d51371113b7fe3bc52690ff232a5b6719bfd
Author: Toomas Soome <tsoome@me.com>
Date:   2019-04-09T19:10:46.000Z

    10672 igb: NULL pointer issues
    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