summaryrefslogtreecommitdiff
path: root/usr/src/uts/sparc
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2020-04-11 00:05:31 +0300
committerToomas Soome <tsoome@me.com>2020-04-24 21:03:27 +0300
commit12551037071c8ef2216bb540edd94a5bff5e90ae (patch)
tree952bbc44a4a8d7a8c077fb181bba89e79b62177b /usr/src/uts/sparc
parent13c31a0ee516ab913296f7367d3c09a79ff3ba21 (diff)
downloadillumos-joyent-12551037071c8ef2216bb540edd94a5bff5e90ae.tar.gz
12532 unix: NULL pointer errors
Reviewed by: Gary Mills <gary_mills@fastmail.fm> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/uts/sparc')
-rw-r--r--usr/src/uts/sparc/fs/proc/prmachdep.c6
-rw-r--r--usr/src/uts/sparc/syscall/getcontext.c10
-rw-r--r--usr/src/uts/sparc/v9/os/v9dep.c13
3 files changed, 14 insertions, 15 deletions
diff --git a/usr/src/uts/sparc/fs/proc/prmachdep.c b/usr/src/uts/sparc/fs/proc/prmachdep.c
index 734f36610f..dc2119f7ba 100644
--- a/usr/src/uts/sparc/fs/proc/prmachdep.c
+++ b/usr/src/uts/sparc/fs/proc/prmachdep.c
@@ -25,7 +25,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
#include <sys/types.h>
#include <sys/t_lock.h>
@@ -422,7 +422,7 @@ prgetprfpregs(klwp_t *lwp, prfpregset_t *pfp)
* This is supposed to be a pointer to the floating point queue.
* We can't provide such a thing through the /proc interface.
*/
- pfp->pr_filler = NULL;
+ pfp->pr_filler = 0;
/*
* XXX: to be done: fetch the FP queue if it is non-empty.
*/
@@ -443,7 +443,7 @@ prgetprfpregs32(klwp_t *lwp, prfpregset32_t *pfp)
* This is supposed to be a pointer to the floating point queue.
* We can't provide such a thing through the /proc interface.
*/
- pfp->pr_filler = NULL;
+ pfp->pr_filler = 0;
/*
* XXX: to be done: fetch the FP queue if it is non-empty.
*/
diff --git a/usr/src/uts/sparc/syscall/getcontext.c b/usr/src/uts/sparc/syscall/getcontext.c
index c9adb54b86..aa933e5d23 100644
--- a/usr/src/uts/sparc/syscall/getcontext.c
+++ b/usr/src/uts/sparc/syscall/getcontext.c
@@ -25,7 +25,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
#include <sys/param.h>
#include <sys/types.h>
@@ -87,7 +87,7 @@ savecontext(ucontext_t *ucp, const k_sigset_t *mask)
* been disabled for this LWP. If stack bounds checking is disabled
* or the copyin() fails, we fall back to the legacy behavior.
*/
- if (lwp->lwp_ustack == NULL ||
+ if (lwp->lwp_ustack == (uintptr_t)NULL ||
copyin((void *)lwp->lwp_ustack, &ucp->uc_stack,
sizeof (ucp->uc_stack)) != 0 ||
ucp->uc_stack.ss_size == 0) {
@@ -384,7 +384,7 @@ savecontext32(ucontext32_t *ucp, const k_sigset_t *mask, struct fq32 *dfq)
* been disabled for this LWP. If stack bounds checking is disabled
* or the copyin() fails, we fall back to the legacy behavior.
*/
- if (lwp->lwp_ustack == NULL ||
+ if (lwp->lwp_ustack == (uintptr_t)NULL ||
copyin((void *)lwp->lwp_ustack, &ucp->uc_stack,
sizeof (ucp->uc_stack)) != 0 ||
ucp->uc_stack.ss_size == 0) {
@@ -410,7 +410,7 @@ savecontext32(ucontext32_t *ucp, const k_sigset_t *mask, struct fq32 *dfq)
if (ucp->uc_mcontext.fpregs.fpu_en == 0)
ucp->uc_flags &= ~UC_FPU;
- ucp->uc_mcontext.gwins = (caddr32_t)NULL;
+ ucp->uc_mcontext.gwins = (caddr32_t)(uintptr_t)NULL;
/*
* Save signal mask (the 32- and 64-bit sigset_t structures are
@@ -464,7 +464,7 @@ getsetcontext32(int flag, void *arg)
* a later setcontext(2).
*/
uc.uc_mcontext.fpregs.fpu_qcnt = 0;
- uc.uc_mcontext.fpregs.fpu_q = (caddr32_t)NULL;
+ uc.uc_mcontext.fpregs.fpu_q = (caddr32_t)(uintptr_t)NULL;
if (copyout(&uc, arg, sizeof (ucontext32_t)))
return (set_errno(EFAULT));
diff --git a/usr/src/uts/sparc/v9/os/v9dep.c b/usr/src/uts/sparc/v9/os/v9dep.c
index 654aee9167..38a905995f 100644
--- a/usr/src/uts/sparc/v9/os/v9dep.c
+++ b/usr/src/uts/sparc/v9/os/v9dep.c
@@ -20,7 +20,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
@@ -121,7 +121,7 @@ setfpregs(klwp_t *lwp, fpregset_t *fp)
/*
* Load up a user's floating point context.
*/
- if (fp->fpu_qcnt > MAXFPQ) /* plug security holes */
+ if (fp->fpu_qcnt > MAXFPQ) /* plug security holes */
fp->fpu_qcnt = MAXFPQ;
fp->fpu_q_entrysize = sizeof (struct _fq);
@@ -819,7 +819,7 @@ setregs(uarg_t *args)
rp->r_y = 0;
curthread->t_post_sys = 1;
lwp->lwp_eosys = JUSTRETURN;
- lwp->lwp_pcb.pcb_trap0addr = NULL; /* no trap 0 handler */
+ lwp->lwp_pcb.pcb_trap0addr = 0; /* no trap 0 handler */
/*
* Clear the fixalignment flag
*/
@@ -1425,7 +1425,7 @@ sendsig32(int sig, k_siginfo_t *sip, void (*hdlr)())
gwp = NULL;
sp += gwin_size;
} else {
- suword32_noerr(&fp->uc.uc_mcontext.gwins, (uint32_t)NULL);
+ suword32_noerr(&fp->uc.uc_mcontext.gwins, 0);
}
if (fpq_size != 0) {
@@ -1455,8 +1455,7 @@ sendsig32(int sig, k_siginfo_t *sip, void (*hdlr)())
mpcb->mpcb_flags |= FP_TRAPPED;
} else {
- suword32_noerr(&fp->uc.uc_mcontext.fpregs.fpu_q,
- (uint32_t)NULL);
+ suword32_noerr(&fp->uc.uc_mcontext.fpregs.fpu_q, 0);
suword8_noerr(&fp->uc.uc_mcontext.fpregs.fpu_qcnt, 0);
}
@@ -1724,7 +1723,7 @@ fpuregset_nto32(const fpregset_t *src, fpregset32_t *dest, struct fq32 *dfq)
bzero(dest, sizeof (*dest));
for (i = 0; i < 32; i++)
dest->fpu_fr.fpu_regs[i] = src->fpu_fr.fpu_regs[i];
- dest->fpu_q = NULL;
+ dest->fpu_q = 0;
dest->fpu_fsr = (uint32_t)src->fpu_fsr;
dest->fpu_qcnt = src->fpu_qcnt;
dest->fpu_q_entrysize = sizeof (struct fpq32);