diff options
| author | Toomas Soome <tsoome@me.com> | 2019-01-18 10:38:01 +0200 |
|---|---|---|
| committer | Toomas Soome <tsoome@me.com> | 2019-02-20 22:08:00 +0200 |
| commit | 7e12ceb3ebc63aeb71e91b496032ca22ca55f660 (patch) | |
| tree | a720628c8eef67512aba873033fc352faac80c8d /usr/src/uts/common/syscall | |
| parent | 7e897d1fc847b22dc338da9a5a59dae0cd8765de (diff) | |
| download | illumos-joyent-7e12ceb3ebc63aeb71e91b496032ca22ca55f660.tar.gz | |
10376 uts: NULL pointer issues in genunix
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: John Levon <john.levon@joyent.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/uts/common/syscall')
| -rw-r--r-- | usr/src/uts/common/syscall/lgrpsys.c | 4 | ||||
| -rw-r--r-- | usr/src/uts/common/syscall/lwp_create.c | 2 | ||||
| -rw-r--r-- | usr/src/uts/common/syscall/poll.c | 8 | ||||
| -rw-r--r-- | usr/src/uts/common/syscall/uadmin.c | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/usr/src/uts/common/syscall/lgrpsys.c b/usr/src/uts/common/syscall/lgrpsys.c index be60d1a445..34bd08fd12 100644 --- a/usr/src/uts/common/syscall/lgrpsys.c +++ b/usr/src/uts/common/syscall/lgrpsys.c @@ -182,7 +182,7 @@ meminfo(int addr_count, struct meminfo *mip) out_array[i] = lgrp->lgrp_id; val_array[i] = VALID_ADDR | VALID_REQ; } else { - out_array[i] = NULL; + out_array[i] = 0; val_array[i] = 0; } } @@ -1857,7 +1857,7 @@ lgrp_snapshot_copy32(caddr32_t buf, size32_t bufsize) snap_size = snap_hdr_size + info_size + cpuids_size + bitmasks_size + lats_size; - if (buf == NULL || bufsize <= 0) { + if (buf == 0 || bufsize <= 0) { return (snap_size); } diff --git a/usr/src/uts/common/syscall/lwp_create.c b/usr/src/uts/common/syscall/lwp_create.c index 53ecd8c5e2..361654cabb 100644 --- a/usr/src/uts/common/syscall/lwp_create.c +++ b/usr/src/uts/common/syscall/lwp_create.c @@ -126,7 +126,7 @@ syslwp_create(ucontext_t *ucp, int flags, id_t *new_lwp) mutex_enter(&curproc->p_lock); pool_barrier_enter(); mutex_exit(&curproc->p_lock); - lwp = lwp_create(lwp_rtt, NULL, NULL, curproc, TS_STOPPED, + lwp = lwp_create(lwp_rtt, NULL, 0, curproc, TS_STOPPED, curthread->t_pri, &sigmask, curthread->t_cid, 0); mutex_enter(&curproc->p_lock); pool_barrier_exit(); diff --git a/usr/src/uts/common/syscall/poll.c b/usr/src/uts/common/syscall/poll.c index 6ffef9e3ec..ae34556f14 100644 --- a/usr/src/uts/common/syscall/poll.c +++ b/usr/src/uts/common/syscall/poll.c @@ -499,12 +499,12 @@ poll_common(pollfd_t *fds, nfds_t nfds, timespec_t *tsp, k_sigset_t *ksetp) /* * Note that pcs_usradr field of an used entry won't be - * NULL because it stores the address of passed-in fds, - * and NULL fds will not be cached (Then it is either + * 0 because it stores the address of passed-in fds, + * and 0 fds will not be cached (Then it is either * the special timeout case when nfds is 0 or it returns * failure directly). */ - if (pcset[cacheindex].pcs_usradr == NULL) { + if (pcset[cacheindex].pcs_usradr == (uintptr_t)NULL) { /* * found an unused entry. Use it to cache * this poll list. @@ -2178,7 +2178,7 @@ pcacheset_cache_list(pollstate_t *ps, pollfd_t *fds, int *fdcntp, int which) pcacheset_remove_list(ps, pollfdp, 0, i, which, 0); kmem_free(newfdlist, ps->ps_nfds * sizeof (pollfd_t)); pcacheset[which].pcs_pollfd = NULL; - pcacheset[which].pcs_usradr = NULL; + pcacheset[which].pcs_usradr = (uintptr_t)NULL; break; } } diff --git a/usr/src/uts/common/syscall/uadmin.c b/usr/src/uts/common/syscall/uadmin.c index 3f261fcda4..858305504d 100644 --- a/usr/src/uts/common/syscall/uadmin.c +++ b/usr/src/uts/common/syscall/uadmin.c @@ -280,7 +280,7 @@ kadmin(int cmd, int fcn, void *mdep, cred_t *credp) * vfs_syncall() can acquire the vfs locks they need. */ sema_p(&fsflush_sema); - (void) callb_execute_class(CB_CL_UADMIN_PRE_VFS, NULL); + (void) callb_execute_class(CB_CL_UADMIN_PRE_VFS, 0); vfs_unmountall(); (void) VFS_MOUNTROOT(rootvfs, ROOT_UNMOUNT); @@ -442,7 +442,7 @@ uadmin(int cmd, int fcn, uintptr_t mdep) * Certain subcommands intepret a non-NULL mdep value as a pointer to * a boot string. We pull that in as bootargs, if applicable. */ - if (mdep != NULL && + if (mdep != (uintptr_t)NULL && (cmd == A_SHUTDOWN || cmd == A_REBOOT || cmd == A_DUMP || cmd == A_FREEZE || cmd == A_CONFIG)) { bootargs = kmem_zalloc(BOOTARGS_MAX, KM_SLEEP); |
