summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/exec/elf/elf.c20
-rw-r--r--usr/src/uts/common/exec/intp/intp.c2
-rw-r--r--usr/src/uts/common/os/core.c4
-rw-r--r--usr/src/uts/common/sys/brand.h2
4 files changed, 12 insertions, 16 deletions
diff --git a/usr/src/uts/common/exec/elf/elf.c b/usr/src/uts/common/exec/elf/elf.c
index 984c1b454a..e1bfab4350 100644
--- a/usr/src/uts/common/exec/elf/elf.c
+++ b/usr/src/uts/common/exec/elf/elf.c
@@ -163,7 +163,6 @@ handle_secflag_dt(proc_t *p, uint_t dt, uint_t val)
return (0);
}
-
#ifndef _ELF32_COMPAT
void
elf_ctx_resize_scratch(elf_core_ctx_t *ctx, size_t sz)
@@ -329,7 +328,6 @@ mapexec_brand(vnode_t *vp, uarg_t *args, Ehdr *ehdr, Addr *uphdr_vaddr,
return (error);
}
-/*ARGSUSED*/
int
elfexec(vnode_t *vp, execa_t *uap, uarg_t *args, intpdata_t *idatap,
int level, size_t *execsz, int setid, caddr_t exec_file, cred_t *cred,
@@ -363,7 +361,7 @@ elfexec(vnode_t *vp, execa_t *uap, uarg_t *args, intpdata_t *idatap,
int hasauxv = 0;
int hasintp = 0;
int branded = 0;
- int dynuphdr = 0;
+ boolean_t dynuphdr = B_FALSE;
struct proc *p = ttoproc(curthread);
struct user *up = PTOU(p);
@@ -740,6 +738,7 @@ elfexec(vnode_t *vp, execa_t *uap, uarg_t *args, intpdata_t *idatap,
error = mapelfexec(vp, ehdrp, nphdrs, phdrbase, &uphdr, &intphdr,
&stphdr, &dtrphdr, dataphdrp, &bssbase, &brkbase, &voffset, NULL,
len, execsz, &brksize);
+
/*
* Our uphdr has been dynamically allocated if (and only if) its
* program header flags are clear. To avoid leaks, this must be
@@ -747,9 +746,8 @@ elfexec(vnode_t *vp, execa_t *uap, uarg_t *args, intpdata_t *idatap,
*/
dynuphdr = (uphdr != NULL && uphdr->p_flags == 0);
- if (error != 0) {
+ if (error != 0)
goto bad;
- }
if (uphdr != NULL && intphdr == NULL)
goto bad;
@@ -1380,8 +1378,9 @@ getelfshdr(vnode_t *vp, cred_t *credp, const Ehdr *ehdr, uint_t nshdrs,
* of the string table section must also be valid.
*/
if (ehdr->e_shentsize < MINSHDRSZ || (ehdr->e_shentsize & 3) ||
- nshdrs == 0 || shstrndx >= nshdrs)
+ nshdrs == 0 || shstrndx >= nshdrs) {
return (EINVAL);
+ }
*shsizep = nshdrs * ehdr->e_shentsize;
@@ -1436,7 +1435,6 @@ getelfshdr(vnode_t *vp, cred_t *credp, const Ehdr *ehdr, uint_t nshdrs,
return (0);
}
-
int
elfreadhdr(vnode_t *vp, cred_t *credp, Ehdr *ehdrp, uint_t *nphdrs,
caddr_t *phbasep, size_t *phsizep)
@@ -1453,7 +1451,6 @@ elfreadhdr(vnode_t *vp, cred_t *credp, Ehdr *ehdrp, uint_t *nphdrs,
return (0);
}
-
static int
mapelfexec(
vnode_t *vp,
@@ -1576,8 +1573,8 @@ mapelfexec(
addr = (caddr_t)((uintptr_t)phdr->p_vaddr + *voffset);
- if ((*intphdr != NULL) && uphdr != NULL &&
- (*uphdr == NULL)) {
+ if (*intphdr != NULL && uphdr != NULL &&
+ *uphdr == NULL) {
/*
* The PT_PHDR program header is, strictly
* speaking, optional. If we find that this
@@ -2764,9 +2761,8 @@ exclude:
done:
if (zeropg != NULL)
kmem_free(zeropg, elf_zeropg_sz);
- if (ctx.ecc_bufsz != 0) {
+ if (ctx.ecc_bufsz != 0)
kmem_free(ctx.ecc_buf, ctx.ecc_bufsz);
- }
kmem_free(bigwad, bigsize);
return (error);
}
diff --git a/usr/src/uts/common/exec/intp/intp.c b/usr/src/uts/common/exec/intp/intp.c
index 388d913ea0..95583a57ce 100644
--- a/usr/src/uts/common/exec/intp/intp.c
+++ b/usr/src/uts/common/exec/intp/intp.c
@@ -26,7 +26,7 @@
*/
/* Copyright (c) 1988 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/* from S5R4 1.6 */
diff --git a/usr/src/uts/common/os/core.c b/usr/src/uts/common/os/core.c
index a147b1cf0f..3df98d0f6d 100644
--- a/usr/src/uts/common/os/core.c
+++ b/usr/src/uts/common/os/core.c
@@ -21,12 +21,12 @@
/*
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2019 Joyent Inc.
* Copyright (c) 2016 by Delphix. All rights reserved.
+ * Copyright 2019 Joyent Inc.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
#include <sys/param.h>
#include <sys/types.h>
diff --git a/usr/src/uts/common/sys/brand.h b/usr/src/uts/common/sys/brand.h
index df22f492bf..bace1142f9 100644
--- a/usr/src/uts/common/sys/brand.h
+++ b/usr/src/uts/common/sys/brand.h
@@ -210,7 +210,7 @@ struct brand_ops {
*/
typedef struct brand {
int b_version;
- char *b_name;
+ char *b_name;
struct brand_ops *b_ops;
struct brand_mach_ops *b_machops;
size_t b_data_size;