summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2016-05-10 10:26:07 +0000
committertrasz <trasz@FreeBSD.org>2016-05-10 10:26:07 +0000
commit94bd76e61952dcaf3297e4ef783550b1a90d09fb (patch)
treec5febf1a9ceae60c6671eddc655f12da14912c0e
parentada488c0486944ebf2f5a84870304c589d8eb39a (diff)
downloadFreeBSD-src-94bd76e61952dcaf3297e4ef783550b1a90d09fb.zip
FreeBSD-src-94bd76e61952dcaf3297e4ef783550b1a90d09fb.tar.gz
Remove misc NULL checks after M_WAITOK allocations.
MFC after: 1 month Sponsored by: The FreeBSD Foundation
-rw-r--r--sys/dev/acpica/acpi_perf.c2
-rw-r--r--sys/dev/hwpmc/hwpmc_piv.c3
-rw-r--r--sys/dev/ioat/ioat.c2
-rw-r--r--sys/dev/xen/evtchn/evtchn_dev.c2
-rw-r--r--sys/x86/xen/pv.c2
5 files changed, 0 insertions, 11 deletions
diff --git a/sys/dev/acpica/acpi_perf.c b/sys/dev/acpica/acpi_perf.c
index d95cc79..df0fa9a 100644
--- a/sys/dev/acpica/acpi_perf.c
+++ b/sys/dev/acpica/acpi_perf.c
@@ -267,8 +267,6 @@ acpi_perf_evaluate(device_t dev)
sc->px_states = malloc(sc->px_count * sizeof(struct acpi_px),
M_ACPIPERF, M_WAITOK | M_ZERO);
- if (sc->px_states == NULL)
- goto out;
/*
* Each state is a package of {CoreFreq, Power, TransitionLatency,
diff --git a/sys/dev/hwpmc/hwpmc_piv.c b/sys/dev/hwpmc/hwpmc_piv.c
index 872ad89..8b106fb 100644
--- a/sys/dev/hwpmc/hwpmc_piv.c
+++ b/sys/dev/hwpmc/hwpmc_piv.c
@@ -605,9 +605,6 @@ p4_pcpu_init(struct pmc_mdep *md, int cpu)
p4c = malloc(sizeof(struct p4_cpu), M_PMC, M_WAITOK|M_ZERO);
- if (p4c == NULL)
- return (ENOMEM);
-
pc = pmc_pcpu[cpu];
KASSERT(pc != NULL, ("[p4,%d] cpu %d null per-cpu", __LINE__, cpu));
diff --git a/sys/dev/ioat/ioat.c b/sys/dev/ioat/ioat.c
index 2a68e6e..bda0454 100644
--- a/sys/dev/ioat/ioat.c
+++ b/sys/dev/ioat/ioat.c
@@ -464,8 +464,6 @@ ioat3_attach(device_t device)
ioat->ring = malloc(num_descriptors * sizeof(*ring), M_IOAT,
M_ZERO | M_WAITOK);
- if (ioat->ring == NULL)
- return (ENOMEM);
ring = ioat->ring;
for (i = 0; i < num_descriptors; i++) {
diff --git a/sys/dev/xen/evtchn/evtchn_dev.c b/sys/dev/xen/evtchn/evtchn_dev.c
index 14eef13..5d54d6d 100644
--- a/sys/dev/xen/evtchn/evtchn_dev.c
+++ b/sys/dev/xen/evtchn/evtchn_dev.c
@@ -325,8 +325,6 @@ evtchn_write(struct cdev *dev, struct uio *uio, int ioflag)
return (EINVAL);
kbuf = malloc(PAGE_SIZE, M_EVTCHN, M_WAITOK);
- if (kbuf == NULL)
- return (ENOMEM);
count = uio->uio_resid;
/* Whole number of ports. */
diff --git a/sys/x86/xen/pv.c b/sys/x86/xen/pv.c
index 1cea294..9ad9aa9 100644
--- a/sys/x86/xen/pv.c
+++ b/sys/x86/xen/pv.c
@@ -226,8 +226,6 @@ start_xen_ap(int cpu)
bootAP = cpu;
ctxt = malloc(sizeof(*ctxt), M_TEMP, M_WAITOK | M_ZERO);
- if (ctxt == NULL)
- panic("unable to allocate memory");
ctxt->flags = VGCF_IN_KERNEL;
ctxt->user_regs.rip = (unsigned long) init_secondary;
OpenPOWER on IntegriCloud