Project

General

Profile

Bug #10755

pset: 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-12
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/syscall/pset.c:26:
    ../../common/syscall/pset.c: In function 'pset_list':
    ../../common/sys/null.h:32:14: error: passing argument 2 of 'cpupart_list' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/syscall/pset.c:772:33: note: in expansion of macro 'NULL'
       real_npsets = cpupart_list(0, NULL, CP_ALL);
                                     ^~~~
    In file included from ../../common/syscall/pset.c:34:0:
    ../../common/sys/cpupart.h:148:15: note: expected 'uint_t {aka unsigned int}' but argument is of type 'void *'
     extern uint_t cpupart_list(psetid_t *, uint_t, int);
                   ^~~~~~~~~~~~
    cc1: all warnings being treated as errors

History

#1

Updated by Toomas Soome 7 months ago

Toomas Soome wrote:

NULL pointer errors:
[...]

also the first argument for cpupart_list() is pointer, so we need to have patch:

--- a/usr/src/uts/common/syscall/pset.c
+++ b/usr/src/uts/common/syscall/pset.c
@@ -769,7 +769,7 @@ pset_list(psetid_t *psetlist, uint_t *numpsets)
                        psets[0] = psetid;
                }
        } else {
-               real_npsets = cpupart_list(0, NULL, CP_ALL);
+               real_npsets = cpupart_list(NULL, 0, CP_ALL);
                if (real_npsets) {
                        psets = kmem_alloc(real_npsets * sizeof (psetid_t),
                            KM_SLEEP);
-- 

#2

Updated by Electric Monk 7 months ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100

git commit 0e9010a07773b58f294e1a0824eebea0b9f37eb8

commit  0e9010a07773b58f294e1a0824eebea0b9f37eb8
Author: Toomas Soome <tsoome@me.com>
Date:   2019-04-18T14:06:25.000Z

    10755 pset: NULL pointer errors
    Reviewed by: Sebastian Wiedenroth <sebastian.wiedenroth@skylime.net>
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF