summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2016-06-27 21:44:27 +0000
committerbdrewery <bdrewery@FreeBSD.org>2016-06-27 21:44:27 +0000
commit46cba9192e970d80d556791991862b19bea90ea2 (patch)
treee219d7b0b673d1ab0c59d802295815d4dff937f4 /sys/kern
parent039c648cc1096a798918c59ba356afa274b0c3b4 (diff)
downloadFreeBSD-src-46cba9192e970d80d556791991862b19bea90ea2.zip
FreeBSD-src-46cba9192e970d80d556791991862b19bea90ea2.tar.gz
MFC r297391:
Remove some NULL checks for M_WAITOK allocations.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/imgact_elf.c4
-rw-r--r--sys/kern/kern_exec.c4
-rw-r--r--sys/kern/kern_linker.c2
3 files changed, 0 insertions, 10 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index e3c08de..1e237c2 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -1325,10 +1325,6 @@ __elfN(coredump)(struct thread *td, struct vnode *vp, off_t limit, int flags)
* and write it out following the notes.
*/
hdr = malloc(hdrsize, M_TEMP, M_WAITOK);
- if (hdr == NULL) {
- error = EINVAL;
- goto done;
- }
error = __elfN(corehdr)(td, vp, cred, seginfo.count, hdr, hdrsize,
&notelst, notesz, gzfile);
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 6ccfaa3..d274ff3 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1498,8 +1498,6 @@ exec_register(execsw_arg)
for (es = execsw; *es; es++)
count++;
newexecsw = malloc(count * sizeof(*es), M_TEMP, M_WAITOK);
- if (newexecsw == NULL)
- return (ENOMEM);
xs = newexecsw;
if (execsw)
for (es = execsw; *es; es++)
@@ -1532,8 +1530,6 @@ exec_unregister(execsw_arg)
if (*es != execsw_arg)
count++;
newexecsw = malloc(count * sizeof(*es), M_TEMP, M_WAITOK);
- if (newexecsw == NULL)
- return (ENOMEM);
xs = newexecsw;
for (es = execsw; *es; es++)
if (*es != execsw_arg)
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index 78eab87..757837b 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -1762,8 +1762,6 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname,
goto bad;
}
hints = malloc(vattr.va_size, M_TEMP, M_WAITOK);
- if (hints == NULL)
- goto bad;
error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t)hints, vattr.va_size, 0,
UIO_SYSSPACE, IO_NODELOCKED, cred, NOCRED, &reclen, td);
if (error)
OpenPOWER on IntegriCloud