Project

General

Profile

Bug #10774

pcmcia: NULL pointer errors

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

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

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

NULL pointer errors:

    In file included from ../../common/sys/param.h:48:0,
                     from ../../common/sys/t_lock.h:38,
                     from ../../common/sys/systm.h:39,
                     from ../../common/pcmcia/cis/cis.c:40:
    ../../common/pcmcia/cis/cis.c: In function 'cis_process_longlink':
    ../../common/sys/null.h:32:14: error: passing argument 5 of 'cis_tuple_handler' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/pcmcia/cis/cis.c:641:17: note: in expansion of macro 'NULL'
           cisparse, NULL) &
                     ^~~~
    In file included from ../../common/pcmcia/cis/cis.c:67:0:
    ../../common/pcmcia/sys/cis_protos.h:57:10: note: expected 'cisdata_t {aka unsigned char}' but argument is of type 'void *'
     uint32_t cis_tuple_handler(cistpl_callout_t *, cistpl_t *, uint32_t,
              ^~~~~~~~~~~~~~~~~
    ../../common/pcmcia/cis/cis.c: In function 'cis_convert_devspeed':
    ../../common/pcmcia/cis/cis.c:893:37: error: comparison between pointer and integer [-Werror]
         (CISTPL_DEVSPEED_MAX_MAN - 1))) == NULL) {
                                         ^~
    ../../common/pcmcia/cis/cis.c:894:38: error: comparison between pointer and integer [-Werror]
       if ((cs->nS = cd->table[exponent]) == NULL)
                                          ^~
    ../../common/pcmcia/cis/cis.c:899:37: error: comparison between pointer and integer [-Werror]
          cd->exponent[exponent]) / 10)) == NULL)
                                         ^~
    In file included from ../../common/sys/param.h:48:0,
                     from ../../common/sys/t_lock.h:38,
                     from ../../common/sys/systm.h:39,
                     from ../../common/pcmcia/cis/cis.c:40:
    ../../common/pcmcia/cis/cis.c: In function 'cis_list_create':
    ../../common/sys/null.h:32:14: error: passing argument 2 of 'cis_get_ltuple' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/pcmcia/cis/cis.c:1129:30: note: in expansion of macro 'NULL'
        gtp = cis_get_ltuple(gtp, NULL, GET_NEXT_LTUPLEF |
                                  ^~~~
    ../../common/pcmcia/cis/cis.c:754:1: note: expected 'cisdata_t {aka unsigned char}' but argument is of type 'void *'
     cis_get_ltuple(cistpl_t *tp, cisdata_t type, uint32_t flags)
     ^~~~~~~~~~~~~~
    In file included from ../../common/sys/param.h:48:0,
                     from ../../common/sys/t_lock.h:38,
                     from ../../common/sys/systm.h:39,
                     from ../../common/pcmcia/cis/cis.c:40:
    ../../common/pcmcia/cis/cis.c: In function 'cis_create_cis_chain':
    ../../common/sys/null.h:32:14: error: passing argument 2 of 'cis_get_ltuple' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/pcmcia/cis/cis.c:1287:53: note: in expansion of macro 'NULL'
           cis_info->cis = cis_get_ltuple(cis_info->cis, NULL,
                                                         ^~~~
    ../../common/pcmcia/cis/cis.c:754:1: note: expected 'cisdata_t {aka unsigned char}' but argument is of type 'void *'
     cis_get_ltuple(cistpl_t *tp, cisdata_t type, uint32_t flags)
     ^~~~~~~~~~~~~~
    In file included from ../../common/sys/param.h:48:0,
                     from ../../common/sys/t_lock.h:38,
                     from ../../common/sys/systm.h:39,
                     from ../../common/pcmcia/cis/cis.c:40:
    ../../common/sys/null.h:32:14: error: passing argument 2 of 'cis_get_ltuple' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/pcmcia/cis/cis.c:1300:53: note: in expansion of macro 'NULL'
           cis_info->cis = cis_get_ltuple(cis_info->cis, NULL,
                                                         ^~~~
    ../../common/pcmcia/cis/cis.c:754:1: note: expected 'cisdata_t {aka unsigned char}' but argument is of type 'void *'
     cis_get_ltuple(cistpl_t *tp, cisdata_t type, uint32_t flags)
     ^~~~~~~~~~~~~~

    ../../common/pcmcia/nexus/pcmcia.c: In function 'pcmcia_init_adapter':
    ../../common/pcmcia/nexus/pcmcia.c:1155:58: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
          pca_name[sizeof (pcmcia_adapters[i]->pca_name) - 1] = NULL;
                                                              ^

    ../../common/pcmcia/cis/cis_handlers.c: In function 'cistpl_linktarget_handler':
    ../../common/pcmcia/cis/cis_handlers.c:1880:31: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
         cs->tpltg_tag[cs->length] = NULL;
                                   ^
    In file included from ../../common/pcmcia/cis/cis_handlers.c:59:0:
    ../../common/pcmcia/cis/cis_handlers.c: In function 'cis_validate_longlink_acm':
    ../../common/pcmcia/sys/cis.h:219:38: error: pointer/integer type mismatch in conditional expression [-Werror]
         ((ptr->offset > ptr->size)?(NULL):ptr->offset))
                                          ^
    ../../common/pcmcia/cis/cis_handlers.c:2108:8: note: in expansion of macro 'NEXT_CIS_ADDR'
       if (!NEXT_CIS_ADDR(cpt))
            ^~~~~~~~~~~~~
    ../../common/pcmcia/cis/cis_handlers.c: In function 'cis_getstr':
    ../../common/pcmcia/cis/cis_handlers.c:2150:7: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      *cpp = NULL;
           ^
    ../../common/pcmcia/cis/cis_handlers.c: In function 'cis_return_name':
    ../../common/pcmcia/cis/cis_handlers.c:2167:40: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      gtn->name[CIS_MAX_TUPLE_NAME_LEN - 1] = NULL;
                                            ^

    ../../common/pcmcia/cs/cs.c: In function 'cs_add_client_to_socket':
    ../../common/pcmcia/cs/cs.c:1924:37: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      cr->driver_name[MODMAXNAMELEN - 1] = NULL;
                                         ^
    In file included from ../../common/sys/param.h:48:0,
                     from ../../common/sys/t_lock.h:38,
                     from ../../common/sys/systm.h:39,
                     from ../../common/pcmcia/cs/cs.c:47:
    ../../common/pcmcia/cs/cs.c: In function 'cs_card_for_client':
    ../../common/sys/null.h:32:14: error: passing argument 5 of 'ddi_getprop' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/pcmcia/cs/cs.c:3616:24: note: in expansion of macro 'NULL'
            PCM_DEV_ACTIVE, NULL)) {
                            ^~~~
    In file included from ../../common/pcmcia/cs/cs.c:58:0:
    ../../common/sys/sunddi.h:905:1: note: expected 'int' but argument is of type 'void *'
     ddi_getprop(dev_t dev, dev_info_t *dip, int flags, char *name, int defvalue);
     ^~~~~~~~~~~
    In file included from ../../common/sys/param.h:48:0,
                     from ../../common/sys/t_lock.h:38,
                     from ../../common/sys/systm.h:39,
                     from ../../common/pcmcia/cs/cs.c:47:
    ../../common/pcmcia/cs/cs.c: In function 'cs_modify_window':
    ../../common/sys/null.h:32:14: error: passing argument 4 of 'cs_modify_mem_window' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/pcmcia/cs/cs.c:4892:50: note: in expansion of macro 'NULL'
      if ((error = cs_modify_mem_window(wh, mw, NULL, NULL)) != CS_SUCCESS) {
                                                      ^~~~
    ../../common/pcmcia/cs/cs.c:176:12: note: expected 'int' but argument is of type 'void *'
     static int cs_modify_mem_window(window_handle_t, modify_win_t *, win_req_t *,
                ^~~~~~~~~~~~~~~~~~~~
    In file included from ../../common/sys/param.h:48:0,
                     from ../../common/sys/t_lock.h:38,
                     from ../../common/sys/systm.h:39,
                     from ../../common/pcmcia/cs/cs.c:47:
    ../../common/pcmcia/cs/cs.c: In function 'cs_request_io':
    ../../common/sys/null.h:32:14: error: passing argument 5 of 'cs_setup_io_win' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/pcmcia/cs/cs.c:5673:18: note: in expansion of macro 'NULL'
          NULL, NULL, NULL,
                      ^~~~
    ../../common/pcmcia/cs/cs.c:192:12: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *'
     static int cs_setup_io_win(uint32_t, uint32_t, baseaddru_t *,
                ^~~~~~~~~~~~~~~
    In file included from ../../common/sys/param.h:48:0,
                     from ../../common/sys/t_lock.h:38,
                     from ../../common/sys/systm.h:39,
                     from ../../common/pcmcia/cs/cs.c:47:
    ../../common/sys/null.h:32:14: error: passing argument 5 of 'cs_setup_io_win' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/pcmcia/cs/cs.c:5704:19: note: in expansion of macro 'NULL'
           NULL, NULL, NULL,
                       ^~~~
    ../../common/pcmcia/cs/cs.c:192:12: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *'
     static int cs_setup_io_win(uint32_t, uint32_t, baseaddru_t *,
                ^~~~~~~~~~~~~~~
    In file included from ../../common/sys/param.h:48:0,
                     from ../../common/sys/t_lock.h:38,
                     from ../../common/sys/systm.h:39,
                     from ../../common/pcmcia/cs/cs.c:47:
    ../../common/sys/null.h:32:14: error: passing argument 5 of 'cs_setup_io_win' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/pcmcia/cs/cs.c:5725:19: note: in expansion of macro 'NULL'
           NULL, NULL, NULL,
                       ^~~~
    ../../common/pcmcia/cs/cs.c:192:12: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *'
     static int cs_setup_io_win(uint32_t, uint32_t, baseaddru_t *,
                ^~~~~~~~~~~~~~~
    In file included from ../../common/sys/param.h:48:0,
                     from ../../common/sys/t_lock.h:38,
                     from ../../common/sys/systm.h:39,
                     from ../../common/pcmcia/cs/cs.c:47:
    ../../common/sys/null.h:32:14: error: passing argument 5 of 'cs_setup_io_win' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/pcmcia/cs/cs.c:5731:19: note: in expansion of macro 'NULL'
           NULL, NULL, NULL,
                       ^~~~
    ../../common/pcmcia/cs/cs.c:192:12: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *'
     static int cs_setup_io_win(uint32_t, uint32_t, baseaddru_t *,
                ^~~~~~~~~~~~~~~
    In file included from ../../common/sys/param.h:48:0,
                     from ../../common/sys/t_lock.h:38,
                     from ../../common/sys/systm.h:39,
                     from ../../common/pcmcia/cs/cs.c:47:
    ../../common/pcmcia/cs/cs.c: In function 'cs_release_io':
    ../../common/sys/null.h:32:14: error: passing argument 5 of 'cs_setup_io_win' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/pcmcia/cs/cs.c:5910:19: note: in expansion of macro 'NULL'
           NULL, NULL, NULL,
                       ^~~~
    ../../common/pcmcia/cs/cs.c:192:12: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *'
     static int cs_setup_io_win(uint32_t, uint32_t, baseaddru_t *,
                ^~~~~~~~~~~~~~~
    In file included from ../../common/sys/param.h:48:0,
                     from ../../common/sys/t_lock.h:38,
                     from ../../common/sys/systm.h:39,
                     from ../../common/pcmcia/cs/cs.c:47:
    ../../common/sys/null.h:32:14: error: passing argument 5 of 'cs_setup_io_win' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/pcmcia/cs/cs.c:5916:19: note: in expansion of macro 'NULL'
           NULL, NULL, NULL,
                       ^~~~
    ../../common/pcmcia/cs/cs.c:192:12: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *'
     static int cs_setup_io_win(uint32_t, uint32_t, baseaddru_t *,
                ^~~~~~~~~~~~~~~
    ../../common/pcmcia/cs/cs.c: In function 'cs_get_physical_adapter_info':
    ../../common/pcmcia/cs/cs.c:7369:9: error: comparison between pointer and integer [-Werror]
      if (ch == NULL)
             ^~
    ../../common/pcmcia/cs/cs.c:7378:18: error: comparison between pointer and integer [-Werror]
          return ((ch == NULL) ? CS_BAD_SOCKET : CS_BAD_HANDLE);
                      ^~
    ../../common/pcmcia/cs/cs.c:7385:9: error: comparison between pointer and integer [-Werror]
      if (ch != NULL) {
             ^~
    ../../common/pcmcia/cs/cs.c: In function 'cs_map_log_socket':
    ../../common/pcmcia/cs/cs.c:7438:9: error: comparison between pointer and integer [-Werror]
      if (ch == NULL)
             ^~
    ../../common/pcmcia/cs/cs.c:7447:18: error: comparison between pointer and integer [-Werror]
          return ((ch == NULL) ? CS_BAD_SOCKET : CS_BAD_HANDLE);
                      ^~
    ../../common/pcmcia/cs/cs.c:7454:9: error: comparison between pointer and integer [-Werror]
      if (ch != NULL) {
             ^~
    ../../common/pcmcia/cs/cs.c: In function 'cs_event2text':
    ../../common/pcmcia/cs/cs.c:7570:34: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       e2t->text[strlen(e2t->text)-1] = NULL;
                                      ^
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk 7 months ago

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

git commit c48c304592e7c2469d5b721291b1f57069f08d33

commit  c48c304592e7c2469d5b721291b1f57069f08d33
Author: Toomas Soome <tsoome@me.com>
Date:   2019-04-24T06:50:36.000Z

    10774 pcmcia: NULL pointer errors
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF