Project

General

Profile

Actions

Bug #10614

closed

mpt_sas: NULL pointer errors

Added by Toomas Soome about 3 years ago. Updated about 3 years ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with NULL pointer:

    In file included from ../../../../src/uts/common/sys/param.h:48:0,
                     from ../../../../src/uts/common/sys/scsi/scsi_types.h:39,
                     from ../../../../src/uts/common/sys/scsi/scsi.h:36,
                     from ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:69:
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c: In function 'mptsas_ioc_get_facts':
    ../../../../src/uts/common/sys/null.h:32:14: error: passing argument 3 of 'mptsas_do_dma' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:181:58: note: in expansion of macro 'NULL'
      if (mptsas_do_dma(mpt, sizeof (MPI2_IOC_FACTS_REQUEST), NULL,
                                                              ^~~~
    In file included from ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:82:0:
    ../../../../src/uts/common/sys/scsi/adapters/mpt_sas/mptsas_var.h:1292:5: note: expected 'int' but argument is of type 'void *'
     int mptsas_do_dma(mptsas_t *mpt, uint32_t size, int var, int (*callback)());
         ^~~~~~~~~~~~~
    In file included from ../../../../src/uts/common/sys/param.h:48:0,
                     from ../../../../src/uts/common/sys/scsi/scsi_types.h:39,
                     from ../../../../src/uts/common/sys/scsi/scsi.h:36,
                     from ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:69:
    ../../../../src/uts/common/sys/null.h:32:14: error: passing argument 3 of 'mptsas_do_dma' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:189:56: note: in expansion of macro 'NULL'
      if (mptsas_do_dma(mpt, sizeof (MPI2_IOC_FACTS_REPLY), NULL,
                                                            ^~~~
    In file included from ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:82:0:
    ../../../../src/uts/common/sys/scsi/adapters/mpt_sas/mptsas_var.h:1292:5: note: expected 'int' but argument is of type 'void *'
     int mptsas_do_dma(mptsas_t *mpt, uint32_t size, int var, int (*callback)());
         ^~~~~~~~~~~~~
    In file included from ../../../../src/uts/common/sys/param.h:48:0,
                     from ../../../../src/uts/common/sys/scsi/scsi_types.h:39,
                     from ../../../../src/uts/common/sys/scsi/scsi.h:36,
                     from ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:69:
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c: In function 'mptsas_ioc_enable_event_notification':
    ../../../../src/uts/common/sys/null.h:32:14: error: passing argument 3 of 'mptsas_do_dma' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:563:67: note: in expansion of macro 'NULL'
      if (mptsas_do_dma(mpt, sizeof (MPI2_EVENT_NOTIFICATION_REQUEST), NULL,
                                                                       ^~~~
    In file included from ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:82:0:
    ../../../../src/uts/common/sys/scsi/adapters/mpt_sas/mptsas_var.h:1292:5: note: expected 'int' but argument is of type 'void *'
     int mptsas_do_dma(mptsas_t *mpt, uint32_t size, int var, int (*callback)());
         ^~~~~~~~~~~~~
    In file included from ../../../../src/uts/common/sys/param.h:48:0,
                     from ../../../../src/uts/common/sys/scsi/scsi_types.h:39,
                     from ../../../../src/uts/common/sys/scsi/scsi.h:36,
                     from ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:69:
    ../../../../src/uts/common/sys/null.h:32:14: error: passing argument 3 of 'mptsas_do_dma' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:571:65: note: in expansion of macro 'NULL'
      if (mptsas_do_dma(mpt, sizeof (MPI2_EVENT_NOTIFICATION_REPLY), NULL,
                                                                     ^~~~
    In file included from ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:82:0:
    ../../../../src/uts/common/sys/scsi/adapters/mpt_sas/mptsas_var.h:1292:5: note: expected 'int' but argument is of type 'void *'
     int mptsas_do_dma(mptsas_t *mpt, uint32_t size, int var, int (*callback)());
         ^~~~~~~~~~~~~
    In file included from ../../../../src/uts/common/sys/param.h:48:0,
                     from ../../../../src/uts/common/sys/scsi/scsi_types.h:39,
                     from ../../../../src/uts/common/sys/scsi/scsi.h:36,
                     from ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:69:
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c: In function 'mptsas_ioc_init':
    ../../../../src/uts/common/sys/null.h:32:14: error: passing argument 3 of 'mptsas_do_dma' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:644:57: note: in expansion of macro 'NULL'
      if (mptsas_do_dma(mpt, sizeof (MPI2_IOC_INIT_REQUEST), NULL,
                                                             ^~~~
    In file included from ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:82:0:
    ../../../../src/uts/common/sys/scsi/adapters/mpt_sas/mptsas_var.h:1292:5: note: expected 'int' but argument is of type 'void *'
     int mptsas_do_dma(mptsas_t *mpt, uint32_t size, int var, int (*callback)());
         ^~~~~~~~~~~~~
    In file included from ../../../../src/uts/common/sys/param.h:48:0,
                     from ../../../../src/uts/common/sys/scsi/scsi_types.h:39,
                     from ../../../../src/uts/common/sys/scsi/scsi.h:36,
                     from ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:69:
    ../../../../src/uts/common/sys/null.h:32:14: error: passing argument 3 of 'mptsas_do_dma' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:652:55: note: in expansion of macro 'NULL'
      if (mptsas_do_dma(mpt, sizeof (MPI2_IOC_INIT_REPLY), NULL,
                                                           ^~~~
    In file included from ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c:82:0:
    ../../../../src/uts/common/sys/scsi/adapters/mpt_sas/mptsas_var.h:1292:5: note: expected 'int' but argument is of type 'void *'
     int mptsas_do_dma(mptsas_t *mpt, uint32_t size, int var, int (*callback)());
         ^~~~~~~~~~~~~

    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_impl.c: In function 'mptsas_start_config_page_access':
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_impl.c:284:15: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      cmd->cmd_rfm = NULL;
                   ^
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_impl.c: In function 'mptsas_update_flash':
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas_impl.c:1402:15: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      cmd->cmd_rfm = NULL;
                   ^

    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c: In function 'mptsas_cache_frames_destructor':
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c:4199:18: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       p->m_phys_addr = NULL;
                      ^
    In file included from ../../../../src/uts/common/sys/param.h:48:0,
                     from ../../../../src/uts/common/sys/scsi/scsi_types.h:39,
                     from ../../../../src/uts/common/sys/scsi/scsi.h:36,
                     from ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c:70:
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c: In function 'mptsas_free_devhdl':
    ../../../../src/uts/common/sys/null.h:32:14: error: passing argument 7 of 'mptsas_do_passthru' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c:6150:34: note: in expansion of macro 'NULL'
          sizeof (req), sizeof (rep), NULL, 0, NULL, 0, 60, FKIOCTL);
                                      ^~~~
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c:252:12: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *'
     static int mptsas_do_passthru(mptsas_t *mpt, uint8_t *request, uint8_t *reply,
                ^~~~~~~~~~~~~~~~~~
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c: In function 'mptsas_start_passthru':
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c:10679:15: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      cmd->cmd_rfm = NULL;
                   ^
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c: In function 'mptsas_start_diag':
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c:11546:15: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      cmd->cmd_rfm = NULL;
                   ^
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c: In function 'mptsas_get_target_device_info':
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c:13860:42: error: comparison between pointer and integer [-Werror]
          MPI2_SAS_DEVICE_INFO_ATAPI_DEVICE)) == NULL) {
                                              ^~
    In file included from ../../../../src/uts/common/sys/param.h:48:0,
                     from ../../../../src/uts/common/sys/scsi/scsi_types.h:39,
                     from ../../../../src/uts/common/sys/scsi/scsi.h:36,
                     from ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c:70:
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c: In function 'mptsas_send_sep':
    ../../../../src/uts/common/sys/null.h:32:14: error: passing argument 7 of 'mptsas_do_passthru' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c:16881:34: note: in expansion of macro 'NULL'
          sizeof (req), sizeof (rep), NULL, 0, NULL, 0, 60, FKIOCTL);
                                      ^~~~
    ../../../../src/uts/common/io/scsi/adapters/mpt_sas/mptsas.c:11071:1: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *'
     mptsas_do_passthru(mptsas_t *mpt, uint8_t *request, uint8_t *reply,
     ^~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

Actions #1

Updated by Electric Monk about 3 years ago

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

git commit a0ac5a9e39eede37009ac9d9ec3111b8b78b0e56

commit  a0ac5a9e39eede37009ac9d9ec3111b8b78b0e56
Author: Toomas Soome <tsoome@me.com>
Date:   2019-04-02T05:45:10.000Z

    10614 mpt_sas: NULL pointer errors
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Reviewed by: Gergő Doma <domag02@gmail.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF