Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109527958
D45852.id140554.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
50 KB
Referenced Files
None
Subscribers
None
D45852.id140554.diff
View Options
diff --git a/sys/arm/ti/ti_pruss.c b/sys/arm/ti/ti_pruss.c
--- a/sys/arm/ti/ti_pruss.c
+++ b/sys/arm/ti/ti_pruss.c
@@ -184,9 +184,6 @@
sc = dev->si_drv1;
irqs = malloc(sizeof(struct ctl), M_DEVBUF, M_WAITOK);
- if (!irqs)
- return (ENOMEM);
-
irqs->cnt = sc->tstamps.ctl.cnt;
irqs->idx = sc->tstamps.ctl.idx;
diff --git a/sys/arm64/arm64/cmn600.c b/sys/arm64/arm64/cmn600.c
--- a/sys/arm64/arm64/cmn600.c
+++ b/sys/arm64/arm64/cmn600.c
@@ -332,9 +332,6 @@
int i;
node = malloc(sizeof(struct cmn600_node), M_DEVBUF, M_WAITOK);
- if (node == NULL)
- return (NULL);
-
node->sc = sc;
node->nd_offset = node_offset;
node->nd_parent = parent;
@@ -399,8 +396,6 @@
node->nd_children = (struct cmn600_node **)mallocarray(
node->nd_child_count, sizeof(struct cmn600_node *), M_DEVBUF,
M_WAITOK);
- if (node->nd_children == NULL)
- goto FAIL;
for (i = 0; i < node->nd_child_count; i++) {
val = node->nd_read8(node, child_offset + (i * 8));
node->nd_children[i] = cmn600_create_node(sc, val &
@@ -420,9 +415,6 @@
break;
}
return (node);
-FAIL:
- free(node, M_DEVBUF);
- return (NULL);
}
static void
diff --git a/sys/arm64/iommu/smmu.c b/sys/arm64/iommu/smmu.c
--- a/sys/arm64/iommu/smmu.c
+++ b/sys/arm64/iommu/smmu.c
@@ -961,10 +961,6 @@
sz = strtab->num_l1_entries * sizeof(struct l1_desc);
strtab->l1 = malloc(sz, M_SMMU, M_WAITOK | M_ZERO);
- if (strtab->l1 == NULL) {
- contigfree(strtab->vaddr, l1size, M_SMMU);
- return (ENOMEM);
- }
reg = STRTAB_BASE_CFG_FMT_2LVL;
reg |= size << STRTAB_BASE_CFG_LOG2SIZE_S;
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -2687,12 +2687,6 @@
}
entries = malloc(ooa_hdr->alloc_len, M_CTL, M_WAITOK | M_ZERO);
- if (entries == NULL) {
- printf("%s: could not allocate %d bytes for OOA "
- "dump\n", __func__, ooa_hdr->alloc_len);
- retval = ENOMEM;
- break;
- }
mtx_lock(&softc->ctl_lock);
if ((ooa_hdr->flags & CTL_OOA_FLAG_ALL_LUNS) == 0 &&
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -4371,8 +4371,6 @@
struct ieee80211com *ic;
ic = malloc(sizeof(*ic), M_LKPI80211, M_WAITOK | M_ZERO);
- if (ic == NULL)
- return (NULL);
/* Setting these happens later when we have device information. */
ic->ic_softc = NULL;
@@ -4424,10 +4422,6 @@
/* BSD Specific. */
lhw->ic = lkpi_ieee80211_ifalloc();
- if (lhw->ic == NULL) {
- ieee80211_free_hw(hw);
- return (NULL);
- }
IMPROVE();
diff --git a/sys/contrib/rdma/krping/krping_dev.c b/sys/contrib/rdma/krping/krping_dev.c
--- a/sys/contrib/rdma/krping/krping_dev.c
+++ b/sys/contrib/rdma/krping/krping_dev.c
@@ -175,11 +175,6 @@
krping_t *krpingmsg;
krpingmsg = malloc(sizeof *krpingmsg, M_DEVBUF, M_WAITOK|M_ZERO);
- if (!krpingmsg) {
- uprintf("Could not malloc mem!\n");
- return ENOMEM;
- }
-
cp = krpingmsg->msg;
while (uio->uio_resid) {
amt = MIN(uio->uio_resid, remain);
diff --git a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c
--- a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c
@@ -278,8 +278,6 @@
WARN_ON(memhandle != VCHI_MEM_HANDLE_INVALID);
bi = malloc(sizeof(*bi), M_VCPAGELIST, M_WAITOK | M_ZERO);
- if (bi == NULL)
- return VCHIQ_ERROR;
ret = create_pagelist((char __user *)offset, size,
(dir == VCHIQ_BULK_RECEIVE)
diff --git a/sys/dev/al_eth/al_eth.c b/sys/dev/al_eth/al_eth.c
--- a/sys/dev/al_eth/al_eth.c
+++ b/sys/dev/al_eth/al_eth.c
@@ -2004,14 +2004,6 @@
adapter->msix_entries = malloc(msix_vecs*sizeof(*adapter->msix_entries),
M_IFAL, M_ZERO | M_WAITOK);
-
- if (adapter->msix_entries == NULL) {
- device_printf_dbg(adapter->dev, "failed to allocate"
- " msix_entries %d\n", msix_vecs);
- rc = ENOMEM;
- goto exit;
- }
-
/* management vector (GROUP_A) @2*/
adapter->msix_entries[AL_ETH_MGMT_IRQ_IDX].entry = 2;
adapter->msix_entries[AL_ETH_MGMT_IRQ_IDX].vector = 0;
@@ -2299,9 +2291,6 @@
size = sizeof(struct al_eth_tx_buffer) * tx_ring->sw_count;
tx_ring->tx_buffer_info = malloc(size, M_IFAL, M_ZERO | M_WAITOK);
- if (tx_ring->tx_buffer_info == NULL)
- return (ENOMEM);
-
tx_ring->descs_size = tx_ring->hw_count * sizeof(union al_udma_desc);
q_params->size = tx_ring->hw_count;
@@ -2324,10 +2313,6 @@
mtx_init(&tx_ring->br_mtx, "AlRingMtx", NULL, MTX_DEF);
tx_ring->br = buf_ring_alloc(AL_BR_SIZE, M_DEVBUF, M_WAITOK,
&tx_ring->br_mtx);
- if (tx_ring->br == NULL) {
- device_printf(dev, "Critical Failure setting up buf ring\n");
- return (ENOMEM);
- }
/* Allocate taskqueues */
TASK_INIT(&tx_ring->enqueue_task, 0, al_eth_start_xmit, tx_ring);
@@ -2476,9 +2461,6 @@
size += 1;
rx_ring->rx_buffer_info = malloc(size, M_IFAL, M_ZERO | M_WAITOK);
- if (rx_ring->rx_buffer_info == NULL)
- return (ENOMEM);
-
rx_ring->descs_size = rx_ring->hw_count * sizeof(union al_udma_desc);
q_params->size = rx_ring->hw_count;
diff --git a/sys/dev/altera/msgdma/msgdma.c b/sys/dev/altera/msgdma/msgdma.c
--- a/sys/dev/altera/msgdma/msgdma.c
+++ b/sys/dev/altera/msgdma/msgdma.c
@@ -356,11 +356,6 @@
/* Descriptors. */
chan->descs = malloc(nsegments * sizeof(struct msgdma_desc *),
M_DEVBUF, (M_WAITOK | M_ZERO));
- if (chan->descs == NULL) {
- device_printf(sc->dev,
- "%s: Can't allocate memory.\n", __func__);
- return (-1);
- }
chan->dma_map = malloc(nsegments * sizeof(bus_dmamap_t),
M_DEVBUF, (M_WAITOK | M_ZERO));
chan->descs_phys = malloc(nsegments * sizeof(bus_dma_segment_t),
diff --git a/sys/dev/ath/if_ath_lna_div.c b/sys/dev/ath/if_ath_lna_div.c
--- a/sys/dev/ath/if_ath_lna_div.c
+++ b/sys/dev/ath/if_ath_lna_div.c
@@ -96,12 +96,6 @@
ss = malloc(sizeof(struct if_ath_ant_comb_state),
M_TEMP, M_WAITOK | M_ZERO);
- if (ss == NULL) {
- device_printf(sc->sc_dev, "%s: failed to allocate\n",
- __func__);
- /* Don't fail at this point */
- return (0);
- }
/* Fetch the hardware configuration */
OS_MEMZERO(&div_ant_conf, sizeof(div_ant_conf));
diff --git a/sys/dev/ath/if_ath_pci.c b/sys/dev/ath/if_ath_pci.c
--- a/sys/dev/ath/if_ath_pci.c
+++ b/sys/dev/ath/if_ath_pci.c
@@ -269,11 +269,6 @@
__func__, fw->data);
sc->sc_eepromdata =
malloc(fw->datasize, M_TEMP, M_WAITOK | M_ZERO);
- if (! sc->sc_eepromdata) {
- device_printf(dev, "%s: can't malloc eepromdata\n",
- __func__);
- goto bad4;
- }
memcpy(sc->sc_eepromdata, fw->data, fw->datasize);
firmware_put(fw, 0);
}
diff --git a/sys/dev/ath/if_ath_spectral.c b/sys/dev/ath/if_ath_spectral.c
--- a/sys/dev/ath/if_ath_spectral.c
+++ b/sys/dev/ath/if_ath_spectral.c
@@ -112,13 +112,6 @@
ss = malloc(sizeof(struct ath_spectral_state),
M_TEMP, M_WAITOK | M_ZERO);
-
- if (ss == NULL) {
- device_printf(sc->sc_dev, "%s: failed to alloc memory\n",
- __func__);
- return (-ENOMEM);
- }
-
sc->sc_spectral = ss;
(void) ath_hal_spectral_get_config(sc->sc_ah, &ss->spectral_state);
diff --git a/sys/dev/axgbe/xgbe-phy-v2.c b/sys/dev/axgbe/xgbe-phy-v2.c
--- a/sys/dev/axgbe/xgbe-phy-v2.c
+++ b/sys/dev/axgbe/xgbe-phy-v2.c
@@ -3771,8 +3771,6 @@
return (ret);
phy_data = malloc(sizeof(*phy_data), M_AXGBE, M_WAITOK | M_ZERO);
- if (!phy_data)
- return (-ENOMEM);
pdata->phy_data = phy_data;
phy_data->port_mode = XP_GET_BITS(pdata->pp0, XP_PROP_0, PORT_MODE);
diff --git a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c
--- a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c
+++ b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c
@@ -205,19 +205,7 @@
}
req = malloc(msg_temp.len_req, M_BNXT, M_WAITOK | M_ZERO);
- if(!req) {
- device_printf(softc->dev, "%s:%d Memory allocation failed",
- __FUNCTION__, __LINE__);
- return -ENOMEM;
- }
-
resp = malloc(msg_temp.len_resp, M_BNXT, M_WAITOK | M_ZERO);
- if(!resp) {
- device_printf(softc->dev, "%s:%d Memory allocation failed",
- __FUNCTION__, __LINE__);
- ret = -ENOMEM;
- goto end;
- }
if (copyin((void *)msg_temp.usr_req, req, msg_temp.len_req)) {
device_printf(softc->dev, "%s:%d Failed to copy data from user\n",
@@ -237,12 +225,6 @@
(num_ind * sizeof(struct dma_info));
msg2 = malloc(size, M_BNXT, M_WAITOK | M_ZERO);
- if(!msg2) {
- device_printf(softc->dev, "%s:%d Memory allocation failed",
- __FUNCTION__, __LINE__);
- ret = -ENOMEM;
- goto end;
- }
if (copyin((void *)mgmt_req.req.hreq, msg2, size)) {
device_printf(softc->dev, "%s:%d Failed to copy"
diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c
--- a/sys/dev/cxgb/cxgb_main.c
+++ b/sys/dev/cxgb/cxgb_main.c
@@ -2473,8 +2473,6 @@
if (aligned_offset != offset || aligned_len != len) {
buf = malloc(aligned_len, M_DEVBUF, M_WAITOK|M_ZERO);
- if (!buf)
- return (ENOMEM);
err = t3_seeprom_read(adapter, aligned_offset, (u32 *)buf);
if (!err && aligned_len > 4)
err = t3_seeprom_read(adapter,
diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c
--- a/sys/dev/cxgb/cxgb_sge.c
+++ b/sys/dev/cxgb/cxgb_sge.c
@@ -2419,11 +2419,8 @@
q->port = pi;
q->adap = sc;
- if ((q->txq[TXQ_ETH].txq_mr = buf_ring_alloc(cxgb_txq_buf_ring_size,
- M_DEVBUF, M_WAITOK, &q->lock)) == NULL) {
- device_printf(sc->dev, "failed to allocate mbuf ring\n");
- goto err;
- }
+ q->txq[TXQ_ETH].txq_mr = buf_ring_alloc(cxgb_txq_buf_ring_size,
+ M_DEVBUF, M_WAITOK, &q->lock);
if ((q->txq[TXQ_ETH].txq_ifq = malloc(sizeof(struct ifaltq), M_DEVBUF,
M_NOWAIT | M_ZERO)) == NULL) {
device_printf(sc->dev, "failed to allocate ifq\n");
diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.c b/sys/dev/cxgbe/cxgbei/cxgbei.c
--- a/sys/dev/cxgbe/cxgbei/cxgbei.c
+++ b/sys/dev/cxgbe/cxgbei/cxgbei.c
@@ -842,9 +842,6 @@
/* per-adapter softc for iSCSI */
ci = malloc(sizeof(*ci), M_CXGBE, M_ZERO | M_WAITOK);
- if (ci == NULL)
- return (ENOMEM);
-
rc = cxgbei_init(sc, ci);
if (rc != 0) {
free(ci, M_CXGBE);
diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c
--- a/sys/dev/cxgbe/tom/t4_cpl_io.c
+++ b/sys/dev/cxgbe/tom/t4_cpl_io.c
@@ -2125,11 +2125,6 @@
break;
m = mb_alloc_ext_pgs(M_WAITOK, aiotx_free_pgs);
- if (m == NULL) {
- vm_page_unhold_pages(pgs, npages);
- break;
- }
-
m->m_epg_1st_off = pgoff;
m->m_epg_npgs = npages;
if (npages == 1) {
diff --git a/sys/dev/drm2/drm_buffer.c b/sys/dev/drm2/drm_buffer.c
--- a/sys/dev/drm2/drm_buffer.c
+++ b/sys/dev/drm2/drm_buffer.c
@@ -50,45 +50,15 @@
* variable sized */
*buf = malloc(sizeof(struct drm_buffer) + nr_pages*sizeof(char *),
DRM_MEM_DRIVER, M_ZERO | M_WAITOK);
-
- if (*buf == NULL) {
- DRM_ERROR("Failed to allocate drm buffer object to hold"
- " %d bytes in %d pages.\n",
- size, nr_pages);
- return -ENOMEM;
- }
-
(*buf)->size = size;
for (idx = 0; idx < nr_pages; ++idx) {
-
(*buf)->data[idx] =
malloc(min(PAGE_SIZE, size - idx * PAGE_SIZE),
DRM_MEM_DRIVER, M_WAITOK);
-
-
- if ((*buf)->data[idx] == NULL) {
- DRM_ERROR("Failed to allocate %dth page for drm"
- " buffer with %d bytes and %d pages.\n",
- idx + 1, size, nr_pages);
- goto error_out;
- }
-
}
return 0;
-
-error_out:
-
- /* Only last element can be null pointer so check for it first. */
- if ((*buf)->data[idx])
- free((*buf)->data[idx], DRM_MEM_DRIVER);
-
- for (--idx; idx >= 0; --idx)
- free((*buf)->data[idx], DRM_MEM_DRIVER);
-
- free(*buf, DRM_MEM_DRIVER);
- return -ENOMEM;
}
EXPORT_SYMBOL(drm_buffer_alloc);
diff --git a/sys/dev/drm2/drm_crtc.c b/sys/dev/drm2/drm_crtc.c
--- a/sys/dev/drm2/drm_crtc.c
+++ b/sys/dev/drm2/drm_crtc.c
@@ -662,13 +662,6 @@
plane->funcs = funcs;
plane->format_types = malloc(sizeof(uint32_t) * format_count,
DRM_MEM_KMS, M_WAITOK);
- if (!plane->format_types) {
- DRM_DEBUG_KMS("out of memory when allocating plane\n");
- drm_mode_object_put(dev, &plane->base);
- ret = -ENOMEM;
- goto out;
- }
-
memcpy(plane->format_types, formats, format_count * sizeof(uint32_t));
plane->format_count = format_count;
plane->possible_crtcs = possible_crtcs;
@@ -725,8 +718,6 @@
nmode = malloc(sizeof(struct drm_display_mode), DRM_MEM_KMS,
M_WAITOK | M_ZERO);
- if (!nmode)
- return NULL;
if (drm_mode_object_get(dev, &nmode->base, DRM_MODE_OBJECT_MODE)) {
free(nmode, DRM_MEM_KMS);
@@ -1009,9 +1000,6 @@
group->id_list = malloc(total_objects * sizeof(uint32_t),
DRM_MEM_KMS, M_WAITOK | M_ZERO);
- if (!group->id_list)
- return -ENOMEM;
-
group->num_crtcs = 0;
group->num_connectors = 0;
group->num_encoders = 0;
@@ -1997,10 +1985,6 @@
connector_set = malloc(crtc_req->count_connectors *
sizeof(struct drm_connector *),
DRM_MEM_KMS, M_WAITOK);
- if (!connector_set) {
- ret = -ENOMEM;
- goto out;
- }
for (i = 0; i < crtc_req->count_connectors; i++) {
set_connectors_ptr = (uint32_t __user *)(unsigned long)crtc_req->set_connectors_ptr;
@@ -2522,11 +2506,6 @@
}
clips = malloc(num_clips * sizeof(*clips), DRM_MEM_KMS,
M_WAITOK | M_ZERO);
- if (!clips) {
- ret = -ENOMEM;
- goto out_err1;
- }
-
ret = copy_from_user(clips, clips_ptr,
num_clips * sizeof(*clips));
if (ret) {
@@ -2773,15 +2752,10 @@
property = malloc(sizeof(struct drm_property), DRM_MEM_KMS,
M_WAITOK | M_ZERO);
- if (!property)
- return NULL;
- if (num_values) {
+ if (num_values)
property->values = malloc(sizeof(uint64_t)*num_values, DRM_MEM_KMS,
M_WAITOK | M_ZERO);
- if (!property->values)
- goto fail;
- }
ret = drm_mode_object_get(dev, &property->base, DRM_MODE_OBJECT_PROPERTY);
if (ret)
@@ -2907,9 +2881,6 @@
prop_enum = malloc(sizeof(struct drm_property_enum), DRM_MEM_KMS,
M_WAITOK | M_ZERO);
- if (!prop_enum)
- return -ENOMEM;
-
strncpy(prop_enum->name, name, DRM_PROP_NAME_LEN);
prop_enum->name[DRM_PROP_NAME_LEN-1] = '\0';
prop_enum->value = value;
@@ -3103,9 +3074,6 @@
blob = malloc(sizeof(struct drm_property_blob)+length, DRM_MEM_KMS,
M_WAITOK | M_ZERO);
- if (!blob)
- return NULL;
-
ret = drm_mode_object_get(dev, &blob->base, DRM_MODE_OBJECT_BLOB);
if (ret) {
free(blob, DRM_MEM_KMS);
@@ -3433,10 +3401,6 @@
crtc->gamma_store = malloc(gamma_size * sizeof(uint16_t) * 3,
DRM_MEM_KMS, M_WAITOK | M_ZERO);
- if (!crtc->gamma_store) {
- crtc->gamma_size = 0;
- return -ENOMEM;
- }
return 0;
}
@@ -3631,13 +3595,6 @@
mtx_unlock(&dev->event_lock);
e = malloc(sizeof *e, DRM_MEM_KMS, M_WAITOK | M_ZERO);
- if (e == NULL) {
- mtx_lock(&dev->event_lock);
- file_priv->event_space += sizeof e->event;
- mtx_unlock(&dev->event_lock);
- goto out;
- }
-
e->event.base.type = DRM_EVENT_FLIP_COMPLETE;
e->event.base.length = sizeof e->event;
e->event.user_data = page_flip->user_data;
diff --git a/sys/dev/drm2/ttm/ttm_object.c b/sys/dev/drm2/ttm/ttm_object.c
--- a/sys/dev/drm2/ttm/ttm_object.c
+++ b/sys/dev/drm2/ttm/ttm_object.c
@@ -282,11 +282,6 @@
if (unlikely(ret != 0))
return ret;
ref = malloc(sizeof(*ref), M_TTM_OBJ_REF, M_WAITOK);
- if (unlikely(ref == NULL)) {
- ttm_mem_global_free(mem_glob, sizeof(*ref));
- return -ENOMEM;
- }
-
ref->hash.key = base->hash.key;
ref->obj = base;
ref->tfile = tfile;
diff --git a/sys/dev/ena/ena_rss.c b/sys/dev/ena/ena_rss.c
--- a/sys/dev/ena/ena_rss.c
+++ b/sys/dev/ena/ena_rss.c
@@ -279,12 +279,9 @@
struct ena_indir *indir = adapter->rss_indir;
int rc;
- if (indir == NULL) {
+ if (indir == NULL)
adapter->rss_indir = indir = malloc(sizeof(struct ena_indir),
M_DEVBUF, M_WAITOK | M_ZERO);
- if (indir == NULL)
- return (ENOMEM);
- }
rc = ena_rss_indir_get(adapter, indir->table);
if (rc != 0) {
diff --git a/sys/dev/etherswitch/infineon/adm6996fc.c b/sys/dev/etherswitch/infineon/adm6996fc.c
--- a/sys/dev/etherswitch/infineon/adm6996fc.c
+++ b/sys/dev/etherswitch/infineon/adm6996fc.c
@@ -179,10 +179,6 @@
if_initname(sc->ifp[port], name, port);
sc->miibus[port] = malloc(sizeof(device_t), M_ADM6996FC,
M_WAITOK | M_ZERO);
- if (sc->miibus[port] == NULL) {
- err = ENOMEM;
- goto failed;
- }
err = mii_attach(sc->sc_dev, sc->miibus[port], sc->ifp[port],
adm6996fc_ifmedia_upd, adm6996fc_ifmedia_sts, \
BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0);
@@ -255,12 +251,6 @@
sc->portphy = malloc(sizeof(int) * sc->numports, M_ADM6996FC,
M_WAITOK | M_ZERO);
- if (sc->ifp == NULL || sc->ifname == NULL || sc->miibus == NULL ||
- sc->portphy == NULL) {
- err = ENOMEM;
- goto failed;
- }
-
/*
* Attach the PHYs and complete the bus enumeration.
*/
diff --git a/sys/dev/etherswitch/micrel/ksz8995ma.c b/sys/dev/etherswitch/micrel/ksz8995ma.c
--- a/sys/dev/etherswitch/micrel/ksz8995ma.c
+++ b/sys/dev/etherswitch/micrel/ksz8995ma.c
@@ -225,10 +225,6 @@
if_initname(sc->ifp[port], name, port);
sc->miibus[port] = malloc(sizeof(device_t), M_KSZ8995MA,
M_WAITOK | M_ZERO);
- if (sc->miibus[port] == NULL) {
- err = ENOMEM;
- goto failed;
- }
err = mii_attach(sc->sc_dev, sc->miibus[port], sc->ifp[port],
ksz8995ma_ifmedia_upd, ksz8995ma_ifmedia_sts, \
BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0);
@@ -305,12 +301,6 @@
sc->portphy = malloc(sizeof(int) * sc->numports, M_KSZ8995MA,
M_WAITOK | M_ZERO);
- if (sc->ifp == NULL || sc->ifname == NULL || sc->miibus == NULL ||
- sc->portphy == NULL) {
- err = ENOMEM;
- goto failed;
- }
-
/*
* Attach the PHYs and complete the bus enumeration.
*/
diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c
--- a/sys/dev/firewire/if_fwip.c
+++ b/sys/dev/firewire/if_fwip.c
@@ -307,10 +307,6 @@
xferq->bulkxfer = (struct fw_bulkxfer *) malloc(
sizeof(struct fw_bulkxfer) * xferq->bnchunk,
M_FWIP, M_WAITOK);
- if (xferq->bulkxfer == NULL) {
- printf("if_fwip: malloc failed\n");
- return;
- }
STAILQ_INIT(&xferq->stvalid);
STAILQ_INIT(&xferq->stfree);
STAILQ_INIT(&xferq->stdma);
diff --git a/sys/dev/flash/flexspi/flex_spi.c b/sys/dev/flash/flexspi/flex_spi.c
--- a/sys/dev/flash/flexspi/flex_spi.c
+++ b/sys/dev/flash/flexspi/flex_spi.c
@@ -781,12 +781,6 @@
}
sc->buf = malloc(sc->erasesize, SECTOR_BUFFER, M_WAITOK);
- if (sc->buf == NULL) {
- device_printf(sc->dev, "Unable to set up allocate internal buffer\n");
- flex_spi_detach(dev);
- return (ENOMEM);
- }
-
/* Move it to per-flash */
sc->disk = disk_alloc();
sc->disk->d_open = flex_spi_open;
diff --git a/sys/dev/hpt27xx/hpt27xx_osm_bsd.c b/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
--- a/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
+++ b/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
@@ -94,9 +94,6 @@
size = him->get_adapter_size(&pci_id);
hba->ldm_adapter.him_handle = malloc(size, M_DEVBUF, M_WAITOK);
- if (!hba->ldm_adapter.him_handle)
- return ENXIO;
-
hba->pcidev = dev;
hba->pciaddr.tree = 0;
hba->pciaddr.bus = pci_get_bus(dev);
@@ -114,10 +111,6 @@
if (!ldm_register_adapter(&hba->ldm_adapter)) {
size = ldm_get_vbus_size();
vbus_ext = malloc(sizeof(VBUS_EXT) + size, M_DEVBUF, M_WAITOK);
- if (!vbus_ext) {
- free(hba->ldm_adapter.him_handle, M_DEVBUF);
- return ENXIO;
- }
memset(vbus_ext, 0, sizeof(VBUS_EXT));
vbus_ext->ext_type = EXT_TYPE_VBUS;
ldm_create_vbus((PVBUS)vbus_ext->vbus, vbus_ext);
@@ -168,7 +161,6 @@
f->tag, f->count, f->size, f->count*f->size));
for (i=0; i<f->count; i++) {
p = (void **)malloc(f->size, M_DEVBUF, M_WAITOK);
- if (!p) return (ENXIO);
*p = f->head;
f->head = p;
}
@@ -1109,10 +1101,6 @@
for (i=0; i<os_max_queue_comm; i++) {
POS_CMDEXT ext = (POS_CMDEXT)malloc(sizeof(OS_CMDEXT), M_DEVBUF, M_WAITOK);
- if (!ext) {
- os_printk("Can't alloc cmdext(%d)", i);
- return ;
- }
ext->vbus_ext = vbus_ext;
ext->next = vbus_ext->cmdext_list;
vbus_ext->cmdext_list = ext;
@@ -1327,18 +1315,13 @@
if (ioctl_args.nInBufferSize) {
ioctl_args.lpInBuffer = malloc(ioctl_args.nInBufferSize, M_DEVBUF, M_WAITOK);
- if (!ioctl_args.lpInBuffer)
- goto invalid;
if (copyin((void*)piop->lpInBuffer,
ioctl_args.lpInBuffer, piop->nInBufferSize))
goto invalid;
}
- if (ioctl_args.nOutBufferSize) {
+ if (ioctl_args.nOutBufferSize)
ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK | M_ZERO);
- if (!ioctl_args.lpOutBuffer)
- goto invalid;
- }
hpt_do_ioctl(&ioctl_args);
diff --git a/sys/dev/hptnr/hptnr_osm_bsd.c b/sys/dev/hptnr/hptnr_osm_bsd.c
--- a/sys/dev/hptnr/hptnr_osm_bsd.c
+++ b/sys/dev/hptnr/hptnr_osm_bsd.c
@@ -165,7 +165,6 @@
f->tag, f->count, f->size, f->count*f->size));
for (i=0; i<f->count; i++) {
p = (void **)malloc(f->size, M_DEVBUF, M_WAITOK);
- if (!p) return (ENXIO);
*p = f->head;
f->head = p;
}
@@ -1389,10 +1388,6 @@
for (i=0; i<os_max_queue_comm; i++) {
POS_CMDEXT ext = (POS_CMDEXT)malloc(sizeof(OS_CMDEXT), M_DEVBUF, M_WAITOK);
- if (!ext) {
- os_printk("Can't alloc cmdext(%d)", i);
- return ;
- }
ext->vbus_ext = vbus_ext;
ext->next = vbus_ext->cmdext_list;
vbus_ext->cmdext_list = ext;
@@ -1610,19 +1605,14 @@
if (ioctl_args.nInBufferSize) {
ioctl_args.lpInBuffer = malloc(ioctl_args.nInBufferSize, M_DEVBUF, M_WAITOK);
- if (!ioctl_args.lpInBuffer)
- goto invalid;
if (copyin((void*)piop->lpInBuffer,
ioctl_args.lpInBuffer, piop->nInBufferSize))
goto invalid;
}
- if (ioctl_args.nOutBufferSize) {
+ if (ioctl_args.nOutBufferSize)
ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK | M_ZERO);
- if (!ioctl_args.lpOutBuffer)
- goto invalid;
- }
-
+
hpt_do_ioctl(&ioctl_args);
if (ioctl_args.result==HPT_IOCTL_RESULT_OK) {
diff --git a/sys/dev/hptrr/hptrr_osm_bsd.c b/sys/dev/hptrr/hptrr_osm_bsd.c
--- a/sys/dev/hptrr/hptrr_osm_bsd.c
+++ b/sys/dev/hptrr/hptrr_osm_bsd.c
@@ -1032,10 +1032,6 @@
for (i=0; i<os_max_queue_comm; i++) {
POS_CMDEXT ext = (POS_CMDEXT)malloc(sizeof(OS_CMDEXT), M_DEVBUF, M_WAITOK);
- if (!ext) {
- os_printk("Can't alloc cmdext(%d)", i);
- return ;
- }
ext->vbus_ext = vbus_ext;
ext->next = vbus_ext->cmdext_list;
vbus_ext->cmdext_list = ext;
@@ -1252,19 +1248,14 @@
if (ioctl_args.nInBufferSize) {
ioctl_args.lpInBuffer = malloc(ioctl_args.nInBufferSize, M_DEVBUF, M_WAITOK);
- if (!ioctl_args.lpInBuffer)
- goto invalid;
if (copyin((void*)piop->lpInBuffer,
ioctl_args.lpInBuffer, piop->nInBufferSize))
goto invalid;
}
- if (ioctl_args.nOutBufferSize) {
+ if (ioctl_args.nOutBufferSize)
ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK | M_ZERO);
- if (!ioctl_args.lpOutBuffer)
- goto invalid;
- }
-
+
hpt_do_ioctl(&ioctl_args);
if (ioctl_args.result==HPT_IOCTL_RESULT_OK) {
diff --git a/sys/dev/ice/ice_lib.h b/sys/dev/ice/ice_lib.h
--- a/sys/dev/ice/ice_lib.h
+++ b/sys/dev/ice/ice_lib.h
@@ -830,7 +830,7 @@
void ice_set_ctrlq_len(struct ice_hw *hw);
void ice_release_vsi(struct ice_vsi *vsi);
struct ice_vsi *ice_alloc_vsi(struct ice_softc *sc, enum ice_vsi_type type);
-int ice_alloc_vsi_qmap(struct ice_vsi *vsi, const int max_tx_queues,
+void ice_alloc_vsi_qmap(struct ice_vsi *vsi, const int max_tx_queues,
const int max_rx_queues);
void ice_free_vsi_qmaps(struct ice_vsi *vsi);
int ice_initialize_vsi(struct ice_vsi *vsi);
diff --git a/sys/dev/ice/ice_lib.c b/sys/dev/ice/ice_lib.c
--- a/sys/dev/ice/ice_lib.c
+++ b/sys/dev/ice/ice_lib.c
@@ -426,31 +426,23 @@
* all queues for this VSI are not yet assigned an index and thus,
* not ready for use.
*
- * Returns an error code on failure.
*/
-int
+void
ice_alloc_vsi_qmap(struct ice_vsi *vsi, const int max_tx_queues,
const int max_rx_queues)
{
- struct ice_softc *sc = vsi->sc;
int i;
MPASS(max_tx_queues > 0);
MPASS(max_rx_queues > 0);
/* Allocate Tx queue mapping memory */
- if (!(vsi->tx_qmap =
- (u16 *) malloc(sizeof(u16) * max_tx_queues, M_ICE, M_WAITOK))) {
- device_printf(sc->dev, "Unable to allocate Tx qmap memory\n");
- return (ENOMEM);
- }
+ vsi->tx_qmap =
+ (u16 *) malloc(sizeof(u16) * max_tx_queues, M_ICE, M_WAITOK);
/* Allocate Rx queue mapping memory */
- if (!(vsi->rx_qmap =
- (u16 *) malloc(sizeof(u16) * max_rx_queues, M_ICE, M_WAITOK))) {
- device_printf(sc->dev, "Unable to allocate Rx qmap memory\n");
- goto free_tx_qmap;
- }
+ vsi->rx_qmap =
+ (u16 *) malloc(sizeof(u16) * max_rx_queues, M_ICE, M_WAITOK);
/* Mark every queue map as invalid to start with */
for (i = 0; i < max_tx_queues; i++) {
@@ -459,14 +451,6 @@
for (i = 0; i < max_rx_queues; i++) {
vsi->rx_qmap[i] = ICE_INVALID_RES_IDX;
}
-
- return 0;
-
-free_tx_qmap:
- free(vsi->tx_qmap, M_ICE);
- vsi->tx_qmap = NULL;
-
- return (ENOMEM);
}
/**
diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c
--- a/sys/dev/ice/if_ice_iflib.c
+++ b/sys/dev/ice/if_ice_iflib.c
@@ -631,12 +631,8 @@
*/
ice_setup_pf_vsi(sc);
- err = ice_alloc_vsi_qmap(&sc->pf_vsi, scctx->isc_ntxqsets_max,
+ ice_alloc_vsi_qmap(&sc->pf_vsi, scctx->isc_ntxqsets_max,
scctx->isc_nrxqsets_max);
- if (err) {
- device_printf(dev, "Unable to allocate VSI Queue maps\n");
- goto free_main_vsi;
- }
/* Allocate MSI-X vectors (due to isc_flags IFLIB_SKIP_MSIX) */
err = ice_allocate_msix(sc);
@@ -3518,12 +3514,7 @@
mif->vsi = vsi;
/* Reserve VSI queue allocation from PF queues */
- ret = ice_alloc_vsi_qmap(vsi, ICE_DEFAULT_VF_QUEUES, ICE_DEFAULT_VF_QUEUES);
- if (ret) {
- device_printf(dev, "%s: Unable to allocate mirror VSI queue maps (%d queues): %s\n",
- __func__, ICE_DEFAULT_VF_QUEUES, ice_err_str(ret));
- goto release_vsi;
- }
+ ice_alloc_vsi_qmap(vsi, ICE_DEFAULT_VF_QUEUES, ICE_DEFAULT_VF_QUEUES);
vsi->num_tx_queues = vsi->num_rx_queues = ICE_DEFAULT_VF_QUEUES;
/* Assign Tx queues from PF space */
diff --git a/sys/dev/iser/iser_verbs.c b/sys/dev/iser/iser_verbs.c
--- a/sys/dev/iser/iser_verbs.c
+++ b/sys/dev/iser/iser_verbs.c
@@ -212,8 +212,6 @@
device->comps = malloc(device->comps_used * sizeof(*device->comps),
M_ISER_VERBS, M_WAITOK | M_ZERO);
- if (!device->comps)
- goto comps_err;
max_cqe = min(ISER_MAX_CQ_LEN, ib_dev->attrs.max_cqe);
@@ -280,7 +278,6 @@
ib_dealloc_pd(device->pd);
pd_err:
free(device->comps, M_ISER_VERBS);
-comps_err:
ISER_ERR("failed to allocate an IB resource");
return (1);
}
@@ -343,11 +340,6 @@
int ret;
desc = malloc(sizeof(*desc), M_ISER_VERBS, M_WAITOK | M_ZERO);
- if (!desc) {
- ISER_ERR("Failed to allocate a new fastreg descriptor");
- return (NULL);
- }
-
ret = iser_alloc_reg_res(ib_device, pd, &desc->rsc);
if (ret) {
ISER_ERR("failed to allocate reg_resources");
@@ -509,9 +501,6 @@
goto inc_refcnt;
device = malloc(sizeof *device, M_ISER_VERBS, M_WAITOK | M_ZERO);
- if (device == NULL)
- goto out;
-
/* assign this device to the device */
device->ib_device = cma_id->device;
/* init the device and link it into ig device list */
diff --git a/sys/dev/mana/gdma_main.c b/sys/dev/mana/gdma_main.c
--- a/sys/dev/mana/gdma_main.c
+++ b/sys/dev/mana/gdma_main.c
@@ -868,9 +868,6 @@
int err;
queue = malloc(sizeof(*queue), M_DEVBUF, M_WAITOK | M_ZERO);
- if (!queue)
- return ENOMEM;
-
gmi = &queue->mem_info;
err = mana_gd_alloc_memory(gc, spec->queue_size, gmi);
if (err)
@@ -962,9 +959,6 @@
}
req = malloc(req_msg_size, M_DEVBUF, M_WAITOK | M_ZERO);
- if (!req)
- return ENOMEM;
-
mana_gd_init_req_hdr(&req->hdr, GDMA_CREATE_DMA_REGION,
req_msg_size, sizeof(resp));
req->length = length;
@@ -1008,9 +1002,6 @@
return EINVAL;
queue = malloc(sizeof(*queue), M_DEVBUF, M_WAITOK | M_ZERO);
- if (!queue)
- return ENOMEM;
-
gmi = &queue->mem_info;
err = mana_gd_alloc_memory(gc, spec->queue_size, gmi);
if (err)
@@ -1056,9 +1047,6 @@
return EINVAL;
queue = malloc(sizeof(*queue), M_DEVBUF, M_WAITOK | M_ZERO);
- if (!queue)
- return ENOMEM;
-
gmi = &queue->mem_info;
err = mana_gd_alloc_memory(gc, spec->queue_size, gmi);
if (err)
@@ -1480,9 +1468,6 @@
r->map =
malloc(n * sizeof(unsigned long), M_DEVBUF, M_WAITOK | M_ZERO);
- if (!r->map)
- return ENOMEM;
-
r->size = res_avail;
mtx_init(&r->lock_spin, lock_name, NULL, MTX_SPIN);
@@ -1616,10 +1601,6 @@
gc->irq_contexts = malloc(nvec * sizeof(struct gdma_irq_context),
M_DEVBUF, M_WAITOK | M_ZERO);
- if (!gc->irq_contexts) {
- rc = ENOMEM;
- goto err_setup_irq_release;
- }
for (i = 0; i < nvec; i++) {
gic = &gc->irq_contexts[i];
diff --git a/sys/dev/mana/hw_channel.c b/sys/dev/mana/hw_channel.c
--- a/sys/dev/mana/hw_channel.c
+++ b/sys/dev/mana/hw_channel.c
@@ -416,8 +416,6 @@
cq_size = MINIMUM_SUPPORTED_PAGE_SIZE;
hwc_cq = malloc(sizeof(*hwc_cq), M_DEVBUF, M_WAITOK | M_ZERO);
- if (!hwc_cq)
- return ENOMEM;
err = mana_hwc_create_gdma_eq(hwc, eq_size, ctx, callback, &eq);
if (err) {
@@ -438,10 +436,6 @@
comp_buf = mallocarray(q_depth, sizeof(struct gdma_comp),
M_DEVBUF, M_WAITOK | M_ZERO);
- if (!comp_buf) {
- err = ENOMEM;
- goto out;
- }
hwc_cq->hwc = hwc;
hwc_cq->comp_buf = comp_buf;
@@ -476,8 +470,6 @@
dma_buf = malloc(sizeof(*dma_buf) +
q_depth * sizeof(struct hwc_work_request),
M_DEVBUF, M_WAITOK | M_ZERO);
- if (!dma_buf)
- return ENOMEM;
dma_buf->num_reqs = q_depth;
@@ -560,8 +552,6 @@
queue_size = MINIMUM_SUPPORTED_PAGE_SIZE;
hwc_wq = malloc(sizeof(*hwc_wq), M_DEVBUF, M_WAITOK | M_ZERO);
- if (!hwc_wq)
- return ENOMEM;
err = mana_hwc_create_gdma_wq(hwc, q_type, queue_size, &queue);
if (err)
@@ -669,8 +659,6 @@
ctx = malloc(q_depth * sizeof(struct hwc_caller_ctx),
M_DEVBUF, M_WAITOK | M_ZERO);
- if (!ctx)
- return ENOMEM;
for (i = 0; i < q_depth; ++i)
init_completion(&ctx[i].comp_event);
@@ -719,9 +707,6 @@
gc->cq_table = malloc(gc->max_num_cqs * sizeof(struct gdma_queue *),
M_DEVBUF, M_WAITOK | M_ZERO);
- if (!gc->cq_table)
- return ENOMEM;
-
gc->cq_table[cq->id] = cq;
return 0;
@@ -782,8 +767,6 @@
int err;
hwc = malloc(sizeof(*hwc), M_DEVBUF, M_WAITOK | M_ZERO);
- if (!hwc)
- return ENOMEM;
gd->gdma_context = gc;
gd->driver_data = hwc;
diff --git a/sys/dev/mana/mana_en.c b/sys/dev/mana/mana_en.c
--- a/sys/dev/mana/mana_en.c
+++ b/sys/dev/mana/mana_en.c
@@ -921,13 +921,6 @@
apc->rxqs = mallocarray(apc->num_queues, sizeof(struct mana_rxq *),
M_DEVBUF, M_WAITOK | M_ZERO);
- if (!apc->rxqs) {
- bus_dma_tag_destroy(apc->tx_buf_tag);
- bus_dma_tag_destroy(apc->rx_buf_tag);
- apc->rx_buf_tag = NULL;
- return ENOMEM;
- }
-
return 0;
}
@@ -1156,8 +1149,6 @@
req_buf_size = sizeof(*req) + sizeof(mana_handle_t) * num_entries;
req = malloc(req_buf_size, M_DEVBUF, M_WAITOK | M_ZERO);
- if (!req)
- return ENOMEM;
mana_gd_init_req_hdr(&req->hdr, MANA_CONFIG_VPORT_RX, req_buf_size,
sizeof(resp));
@@ -1325,8 +1316,6 @@
ac->eqs = mallocarray(gc->max_num_queues, sizeof(struct mana_eq),
M_DEVBUF, M_WAITOK | M_ZERO);
- if (!ac->eqs)
- return ENOMEM;
spec.type = GDMA_EQ;
spec.monitor_avl_buf = false;
@@ -2043,8 +2032,6 @@
apc->tx_qp = mallocarray(apc->num_queues, sizeof(struct mana_tx_qp),
M_DEVBUF, M_WAITOK | M_ZERO);
- if (!apc->tx_qp)
- return ENOMEM;
/* The minimum size of the WQE is 32 bytes, hence
* MAX_SEND_BUFFERS_PER_QUEUE represents the maximum number of WQEs
@@ -2141,14 +2128,6 @@
txq->tx_buf_info = malloc(MAX_SEND_BUFFERS_PER_QUEUE *
sizeof(struct mana_send_buf_info),
M_DEVBUF, M_WAITOK | M_ZERO);
- if (unlikely(txq->tx_buf_info == NULL)) {
- if_printf(net,
- "Failed to allocate tx buf info for SQ %u\n",
- txq->gdma_sq->id);
- err = ENOMEM;
- goto out;
- }
-
snprintf(txq->txq_mtx_name, nitems(txq->txq_mtx_name),
"mana:tx(%d)", i);
@@ -2156,13 +2135,6 @@
txq->txq_br = buf_ring_alloc(4 * MAX_SEND_BUFFERS_PER_QUEUE,
M_DEVBUF, M_WAITOK, &txq->txq_mtx);
- if (unlikely(txq->txq_br == NULL)) {
- if_printf(net,
- "Failed to allocate buf ring for SQ %u\n",
- txq->gdma_sq->id);
- err = ENOMEM;
- goto out;
- }
/* Allocate taskqueue for deferred send */
TASK_INIT(&txq->enqueue_task, 0, mana_xmit_taskfunc, txq);
@@ -2353,9 +2325,6 @@
rxq = malloc(sizeof(*rxq) +
RX_BUFFERS_PER_QUEUE * sizeof(struct mana_recv_buf_oob),
M_DEVBUF, M_WAITOK | M_ZERO);
- if (!rxq)
- return NULL;
-
rxq->ndev = ndev;
rxq->num_rx_buf = RX_BUFFERS_PER_QUEUE;
rxq->rxq_idx = rxq_idx;
@@ -2808,12 +2777,6 @@
*ndev_storage = ndev;
apc = malloc(sizeof(*apc), M_DEVBUF, M_WAITOK | M_ZERO);
- if (!apc) {
- mana_err(NULL, "Failed to allocate port context\n");
- err = ENOMEM;
- goto free_net;
- }
-
apc->ac = ac;
apc->ndev = ndev;
apc->max_queues = gc->max_num_queues;
@@ -2892,7 +2855,6 @@
reset_apc:
free(apc, M_DEVBUF);
-free_net:
*ndev_storage = NULL;
if_printf(ndev, "Failed to probe vPort %d: %d\n", port_idx, err);
if_free(ndev);
@@ -2915,9 +2877,6 @@
return err;
ac = malloc(sizeof(*ac), M_DEVBUF, M_WAITOK | M_ZERO);
- if (!ac)
- return ENOMEM;
-
ac->gdma_dev = gd;
ac->num_ports = 1;
gd->driver_data = ac;
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -3633,11 +3633,8 @@
mfi_aen_entry = malloc(sizeof(struct mfi_aen), M_MFIBUF,
M_WAITOK);
mtx_lock(&sc->mfi_io_lock);
- if (mfi_aen_entry != NULL) {
- mfi_aen_entry->p = curproc;
- TAILQ_INSERT_TAIL(&sc->mfi_aen_pids, mfi_aen_entry,
- aen_link);
- }
+ mfi_aen_entry->p = curproc;
+ TAILQ_INSERT_TAIL(&sc->mfi_aen_pids, mfi_aen_entry, aen_link);
error = mfi_aen_register(sc, l_aen.laen_seq_num,
l_aen.laen_class_locale);
diff --git a/sys/dev/mlx/mlx.c b/sys/dev/mlx/mlx.c
--- a/sys/dev/mlx/mlx.c
+++ b/sys/dev/mlx/mlx.c
@@ -2075,8 +2075,8 @@
goto out;
}
MLX_IO_UNLOCK(sc);
- if (((kbuf = malloc(mu->mu_datasize, M_DEVBUF, M_WAITOK)) == NULL) ||
- (error = copyin(mu->mu_buf, kbuf, mu->mu_datasize))) {
+ kbuf = malloc(mu->mu_datasize, M_DEVBUF, M_WAITOK);
+ if ((error = copyin(mu->mu_buf, kbuf, mu->mu_datasize))) {
MLX_IO_LOCK(sc);
goto out;
}
diff --git a/sys/dev/mpi3mr/mpi3mr_cam.c b/sys/dev/mpi3mr/mpi3mr_cam.c
--- a/sys/dev/mpi3mr/mpi3mr_cam.c
+++ b/sys/dev/mpi3mr/mpi3mr_cam.c
@@ -2098,12 +2098,6 @@
mpi3mr_dprint(sc, MPI3MR_XINFO, "Starting CAM Attach\n");
cam_sc = malloc(sizeof(struct mpi3mr_cam_softc), M_MPI3MR, M_WAITOK|M_ZERO);
- if (!cam_sc) {
- mpi3mr_dprint(sc, MPI3MR_ERROR,
- "Failed to allocate memory for controller CAM instance\n");
- return (ENOMEM);
- }
-
cam_sc->maxtargets = sc->facts.max_perids + 1;
TAILQ_INIT(&cam_sc->tgt_list);
diff --git a/sys/dev/mrsas/mrsas_ioctl.c b/sys/dev/mrsas/mrsas_ioctl.c
--- a/sys/dev/mrsas/mrsas_ioctl.c
+++ b/sys/dev/mrsas/mrsas_ioctl.c
@@ -462,13 +462,6 @@
kern_sge[0].length = 0;
} else {
ioctl_temp_data_mem = malloc(ioc->buf_size, M_MRSAS, M_WAITOK);
- if (ioctl_temp_data_mem == NULL) {
- device_printf(sc->mrsas_dev, "Could not allocate "
- "%d memory for temporary passthrough ioctl\n",
- ioc->buf_size);
- ret = ENOMEM;
- goto out;
- }
/* Copy in data from user space */
ret = copyin(ioc->buf, ioctl_temp_data_mem, ioc->buf_size);
@@ -483,12 +476,6 @@
*/
passcmd = malloc(sizeof(struct mrsas_passthru_cmd), M_MRSAS,
M_WAITOK);
- if (passcmd == NULL) {
- device_printf(sc->mrsas_dev, "Could not allocate "
- "memory for temporary passthrough cb struct\n");
- ret = ENOMEM;
- goto out;
- }
passcmd->complete = 0;
passcmd->sc = sc;
passcmd->cmd = cmd;
diff --git a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
--- a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
+++ b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
@@ -318,13 +318,6 @@
sizeof(void *) );
AGTIAPI_PRINTK("agtiapi_getdevlist: portCount %d\n", pCard->portCount);
devList = malloc(memNeeded1, TEMP2, M_WAITOK);
- if (devList == NULL)
- {
- AGTIAPI_PRINTK("agtiapi_getdevlist: failed to allocate memory\n");
- ret_val = IOCTL_CALL_FAIL;
- agIOCTLPayload->Status = IOCTL_ERR_STATUS_INTERNAL_ERROR;
- return ret_val;
- }
osti_memset(devList, 0, memNeeded1);
pPortalData = &pCard->pPortalData[0];
pDeviceHandleList = (bit8*)devList;
@@ -973,10 +966,6 @@
pmsc->pPortalData = (ag_portal_data_t *)
malloc( sizeof(ag_portal_data_t) * pmsc->portCount,
M_PMC_MPRT, M_ZERO | M_WAITOK );
- if (pmsc->pPortalData == NULL)
- {
- AGTIAPI_PRINTK( "agtiapi_attach: Portal memory allocation ERROR\n" );
- }
}
pPortalData = pmsc->pPortalData;
@@ -1229,30 +1218,15 @@
numVal = sizeof(ag_device_t) * pmsc->devDiscover;
pmsc->pDevList =
(ag_device_t *)malloc( numVal, M_PMC_MDVT, M_ZERO | M_WAITOK );
- if( !pmsc->pDevList ) {
- AGTIAPI_PRINTK( "agtiapi_InitCardHW: kmalloc %d DevList ERROR\n", numVal );
- panic( "agtiapi_InitCardHW\n" );
- return AGTIAPI_FAIL;
- }
#ifdef LINUX_PERBI_SUPPORT
numVal = sizeof(ag_slr_map_t) * pmsc->devDiscover;
pmsc->pSLRList =
(ag_slr_map_t *)malloc( numVal, M_PMC_MSLR, M_ZERO | M_WAITOK );
- if( !pmsc->pSLRList ) {
- AGTIAPI_PRINTK( "agtiapi_InitCardHW: kmalloc %d SLRList ERROR\n", numVal );
- panic( "agtiapi_InitCardHW SLRL\n" );
- return AGTIAPI_FAIL;
- }
numVal = sizeof(ag_tgt_map_t) * pmsc->devDiscover;
pmsc->pWWNList =
(ag_tgt_map_t *)malloc( numVal, M_PMC_MTGT, M_ZERO | M_WAITOK );
- if( !pmsc->pWWNList ) {
- AGTIAPI_PRINTK( "agtiapi_InitCardHW: kmalloc %d WWNList ERROR\n", numVal );
- panic( "agtiapi_InitCardHW WWNL\n" );
- return AGTIAPI_FAIL;
- }
// Get the WWN_to_target_ID mappings from the
// holding area which contains the input of the
diff --git a/sys/dev/qat/qat_common/adf_freebsd_dev_processes.c b/sys/dev/qat/qat_common/adf_freebsd_dev_processes.c
--- a/sys/dev/qat/qat_common/adf_freebsd_dev_processes.c
+++ b/sys/dev/qat/qat_common/adf_freebsd_dev_processes.c
@@ -146,8 +146,6 @@
return ENXIO;
}
prv_data = malloc(sizeof(*prv_data), M_QAT, M_WAITOK | M_ZERO);
- if (!prv_data)
- return ENOMEM;
INIT_LIST_HEAD(&prv_data->list);
error = devfs_set_cdevpriv(prv_data, adf_processes_release);
if (error) {
@@ -573,14 +571,8 @@
int ret = 0;
prv_data = malloc(sizeof(*prv_data), M_QAT, M_WAITOK | M_ZERO);
- if (!prv_data)
- return -ENOMEM;
entry_proc_events =
malloc(sizeof(struct entry_proc_events), M_QAT, M_WAITOK | M_ZERO);
- if (!entry_proc_events) {
- free(prv_data, M_QAT);
- return -ENOMEM;
- }
mtx_lock(&mtx);
prv_data->cdev = dev;
prv_data->cdev->si_drv1 = prv_data;
diff --git a/sys/dev/qat/qat_common/adf_freebsd_uio.c b/sys/dev/qat/qat_common/adf_freebsd_uio.c
--- a/sys/dev/qat/qat_common/adf_freebsd_uio.c
+++ b/sys/dev/qat/qat_common/adf_freebsd_uio.c
@@ -199,10 +199,6 @@
accel = accel_dev->accel;
handle = malloc(sizeof(*handle), M_QAT, M_WAITOK | M_ZERO);
- if (!handle) {
- printf("ERROR in adf_alloc_bundle %d\n", __LINE__);
- return ENOMEM;
- }
handle->accel = accel;
handle->bundle = bundle_nr;
@@ -294,10 +290,6 @@
/* Adding pid to bundle list */
instance_rings =
malloc(sizeof(*instance_rings), M_QAT, M_WAITOK | M_ZERO);
- if (!instance_rings) {
- printf("QAT: Memory allocation error - line: %d\n", __LINE__);
- return -ENOMEM;
- }
instance_rings->user_pid = curproc->p_pid;
instance_rings->ring_mask = 0;
mutex_lock(&bundle->list_lock);
diff --git a/sys/dev/qat/qat_common/adf_freebsd_uio_cleanup.c b/sys/dev/qat/qat_common/adf_freebsd_uio_cleanup.c
--- a/sys/dev/qat/qat_common/adf_freebsd_uio_cleanup.c
+++ b/sys/dev/qat/qat_common/adf_freebsd_uio_cleanup.c
@@ -123,9 +123,6 @@
orphan_bundle =
malloc(sizeof(*orphan_bundle), M_QAT, M_WAITOK | M_ZERO);
- if (!orphan_bundle)
- return ENOMEM;
-
csr_base = accel->bar->virt_addr;
orphan_bundle->csr_base = csr_base;
orphan_bundle->bank = bank;
diff --git a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c
--- a/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c
+++ b/sys/dev/qat/qat_hw/qat_4xxxvf/adf_drv.c
@@ -117,11 +117,6 @@
}
/* Allocate and configure device configuration structure */
hw_data = malloc(sizeof(*hw_data), M_QAT_4XXXVF, M_WAITOK | M_ZERO);
- if (!hw_data) {
- ret = -ENOMEM;
- goto out_err;
- }
-
accel_dev->hw_device = hw_data;
adf_init_hw_data_4xxxiov(accel_dev->hw_device);
accel_pci_dev->revid = pci_get_revid(dev);
diff --git a/sys/dev/sdhci/sdhci_xenon_acpi.c b/sys/dev/sdhci/sdhci_xenon_acpi.c
--- a/sys/dev/sdhci/sdhci_xenon_acpi.c
+++ b/sys/dev/sdhci/sdhci_xenon_acpi.c
@@ -86,8 +86,6 @@
memset(&mmc_helper, 0, sizeof(mmc_helper));
slot = malloc(sizeof(*slot), M_DEVBUF, M_ZERO | M_WAITOK);
- if (!slot)
- return (ENOMEM);
/*
* Don't use regularators.
diff --git a/sys/dev/sound/macio/i2s.c b/sys/dev/sound/macio/i2s.c
--- a/sys/dev/sound/macio/i2s.c
+++ b/sys/dev/sound/macio/i2s.c
@@ -241,10 +241,8 @@
* Register a hook for delayed attach in order to allow
* the I2C controller to attach.
*/
- if ((i2s_delayed_attach = malloc(sizeof(struct intr_config_hook),
- M_TEMP, M_WAITOK | M_ZERO)) == NULL)
- return (ENOMEM);
-
+ i2s_delayed_attach = malloc(sizeof(struct intr_config_hook),
+ M_TEMP, M_WAITOK | M_ZERO);
i2s_delayed_attach->ich_func = i2s_postattach;
i2s_delayed_attach->ich_arg = sc;
diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c
--- a/sys/dev/sound/usb/uaudio.c
+++ b/sys/dev/sound/usb/uaudio.c
@@ -2705,8 +2705,6 @@
DPRINTF("Worst case buffer is %d bytes\n", (int)buf_size);
ch->buf = malloc(buf_size, M_DEVBUF, M_WAITOK | M_ZERO);
- if (ch->buf == NULL)
- goto error;
if (sndbuf_setup(b, ch->buf, buf_size) != 0)
goto error;
@@ -3274,31 +3272,27 @@
malloc(sizeof(*p_mc_new), M_USBDEV, M_WAITOK);
int ch;
- if (p_mc_new != NULL) {
- memcpy(p_mc_new, mc, sizeof(*p_mc_new));
- p_mc_new->next = sc->sc_mixer_root;
- sc->sc_mixer_root = p_mc_new;
- sc->sc_mixer_count++;
+ memcpy(p_mc_new, mc, sizeof(*p_mc_new));
+ p_mc_new->next = sc->sc_mixer_root;
+ sc->sc_mixer_root = p_mc_new;
+ sc->sc_mixer_count++;
- /* set default value for all channels */
- for (ch = 0; ch < p_mc_new->nchan; ch++) {
- switch (p_mc_new->val_default) {
- case 1:
- /* 50% */
- p_mc_new->wData[ch] = (p_mc_new->maxval + p_mc_new->minval) / 2;
- break;
- case 2:
- /* 100% */
- p_mc_new->wData[ch] = p_mc_new->maxval;
- break;
- default:
- /* 0% */
- p_mc_new->wData[ch] = p_mc_new->minval;
- break;
- }
+ /* set default value for all channels */
+ for (ch = 0; ch < p_mc_new->nchan; ch++) {
+ switch (p_mc_new->val_default) {
+ case 1:
+ /* 50% */
+ p_mc_new->wData[ch] = (p_mc_new->maxval + p_mc_new->minval) / 2;
+ break;
+ case 2:
+ /* 100% */
+ p_mc_new->wData[ch] = p_mc_new->maxval;
+ break;
+ default:
+ /* 0% */
+ p_mc_new->wData[ch] = p_mc_new->minval;
+ break;
}
- } else {
- DPRINTF("out of memory\n");
}
}
diff --git a/sys/dev/sume/if_sume.c b/sys/dev/sume/if_sume.c
--- a/sys/dev/sume/if_sume.c
+++ b/sys/dev/sume/if_sume.c
@@ -1195,16 +1195,11 @@
{
struct riffa_chnl_dir **rp;
bus_addr_t hw_addr;
- int error, ch;
+ int ch;
device_t dev = adapter->dev;
- error = ENOMEM;
*p = malloc(SUME_RIFFA_CHANNELS * sizeof(struct riffa_chnl_dir *),
M_SUME, M_ZERO | M_WAITOK);
- if (*p == NULL) {
- device_printf(dev, "malloc(%s) failed.\n", dir);
- return (error);
- }
rp = *p;
/* Allocate the chnl_dir structs themselves. */
@@ -1212,11 +1207,6 @@
/* One direction. */
rp[ch] = malloc(sizeof(struct riffa_chnl_dir), M_SUME,
M_ZERO | M_WAITOK);
- if (rp[ch] == NULL) {
- device_printf(dev, "malloc(%s[%d]) riffa_chnl_dir "
- "failed.\n", dir, ch);
- return (error);
- }
int err = bus_dma_tag_create(bus_get_dma_tag(dev),
4, 0,
diff --git a/sys/fs/udf/udf_vnops.c b/sys/fs/udf/udf_vnops.c
--- a/sys/fs/udf/udf_vnops.c
+++ b/sys/fs/udf/udf_vnops.c
@@ -800,8 +800,6 @@
*/
ncookies = uio->uio_resid / 8;
cookies = malloc(sizeof(*cookies) * ncookies, M_TEMP, M_WAITOK);
- if (cookies == NULL)
- return (ENOMEM);
uiodir.ncookies = ncookies;
uiodir.cookies = cookies;
uiodir.acookies = 0;
diff --git a/sys/kern/kern_boottrace.c b/sys/kern/kern_boottrace.c
--- a/sys/kern/kern_boottrace.c
+++ b/sys/kern/kern_boottrace.c
@@ -561,9 +561,6 @@
}
rt.table = realloc(rt.table, newsize * sizeof(struct bt_event),
M_BOOTTRACE, M_WAITOK | M_ZERO);
- if (rt.table == NULL)
- return (ENOMEM);
-
rt.size = newsize;
boottrace_reset("boottrace_resize");
return (0);
diff --git a/sys/kern/kern_fail.c b/sys/kern/kern_fail.c
--- a/sys/kern/kern_fail.c
+++ b/sys/kern/kern_fail.c
@@ -479,11 +479,10 @@
/* Allocate the name and fill it in. */
name = fp_malloc(n + 1, M_WAITOK);
- if (name != NULL) {
- va_start(ap, fmt);
- vsnprintf(name, n + 1, fmt, ap);
- va_end(ap);
- }
+ va_start(ap, fmt);
+ vsnprintf(name, n + 1, fmt, ap);
+ va_end(ap);
+
fp->fp_name = name;
fp->fp_location = "";
fp->fp_flags |= FAIL_POINT_DYNAMIC_NAME;
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -5422,8 +5422,6 @@
* Populate the return item, careful not to overflow the buffer.
*/
udev = malloc(sizeof(*udev), M_BUS, M_WAITOK | M_ZERO);
- if (udev == NULL)
- return (ENOMEM);
udev->dv_handle = (uintptr_t)dev;
udev->dv_parent = (uintptr_t)dev->parent;
udev->dv_devflags = dev->devflags;
diff --git a/sys/net/altq/altq_subr.c b/sys/net/altq/altq_subr.c
--- a/sys/net/altq/altq_subr.c
+++ b/sys/net/altq/altq_subr.c
@@ -1327,12 +1327,7 @@
return (EINVAL);
#endif
- afp = malloc(sizeof(struct acc_filter),
- M_DEVBUF, M_WAITOK);
- if (afp == NULL)
- return (ENOMEM);
- bzero(afp, sizeof(struct acc_filter));
-
+ afp = malloc(sizeof(*afp), M_DEVBUF, M_WAITOK | M_ZERO);
afp->f_filter = *filter;
afp->f_class = class;
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -508,11 +508,6 @@
return;
hash2 = malloc(sizeof(struct ifvlanhead) * n2, M_VLAN, M_WAITOK);
- if (hash2 == NULL) {
- printf("%s: out of memory -- hash size not changed\n",
- __func__);
- return; /* We can live with the old hash table */
- }
for (j = 0; j < n2; j++)
CK_SLIST_INIT(&hash2[j]);
for (i = 0; i < n; i++)
diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c
--- a/sys/netpfil/pf/pf_ioctl.c
+++ b/sys/netpfil/pf/pf_ioctl.c
@@ -2699,9 +2699,6 @@
/* Copy the request in */
packed = malloc(nv->len, M_NVLIST, M_WAITOK);
- if (packed == NULL)
- ERROUT(ENOMEM);
-
error = copyin(nv->data, packed, nv->len);
if (error)
ERROUT(error);
@@ -2779,9 +2776,6 @@
ERROUT(ENOMEM);
nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK);
- if (nvlpacked == NULL)
- ERROUT(ENOMEM);
-
error = copyin(nv->data, nvlpacked, nv->len);
if (error)
ERROUT(error);
@@ -2879,9 +2873,6 @@
ERROUT(ENOMEM);
nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK);
- if (nvlpacked == NULL)
- ERROUT(ENOMEM);
-
error = copyin(nv->data, nvlpacked, nv->len);
if (error)
ERROUT(error);
@@ -2912,8 +2903,6 @@
}
rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK);
- if (rule == NULL)
- ERROUT(ENOMEM);
rule->timestamp = NULL;
error = pf_nveth_rule_to_keth_rule(nvl, rule);
@@ -3012,9 +3001,6 @@
ERROUT(ENOMEM);
nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK);
- if (nvlpacked == NULL)
- ERROUT(ENOMEM);
-
error = copyin(nv->data, nvlpacked, nv->len);
if (error)
ERROUT(error);
@@ -3090,9 +3076,6 @@
ERROUT(ENOMEM);
nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK);
- if (nvlpacked == NULL)
- ERROUT(ENOMEM);
-
error = copyin(nv->data, nvlpacked, nv->len);
if (error)
ERROUT(error);
@@ -3285,9 +3268,6 @@
/* Copy the request in */
nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK);
- if (nvlpacked == NULL)
- ERROUT(ENOMEM);
-
error = copyin(nv->data, nvlpacked, nv->len);
if (error)
ERROUT(error);
@@ -5973,9 +5953,6 @@
ERROUT(ENOMEM);
nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK);
- if (nvlpacked == NULL)
- ERROUT(ENOMEM);
-
error = copyin(nv->data, nvlpacked, nv->len);
if (error)
ERROUT(error);
@@ -6101,9 +6078,6 @@
ERROUT(ENOMEM);
nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK);
- if (nvlpacked == NULL)
- ERROUT(ENOMEM);
-
error = copyin(nv->data, nvlpacked, nv->len);
if (error)
ERROUT(error);
@@ -6162,9 +6136,6 @@
ERROUT(ENOMEM);
nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK);
- if (nvlpacked == NULL)
- ERROUT(ENOMEM);
-
error = copyin(nv->data, nvlpacked, nv->len);
if (error)
ERROUT(error);
@@ -6223,9 +6194,6 @@
ERROUT(ENOMEM);
nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK);
- if (nvlpacked == NULL)
- ERROUT(ENOMEM);
-
error = copyin(nv->data, nvlpacked, nv->len);
if (error)
ERROUT(error);
diff --git a/sys/netpfil/pf/pf_syncookies.c b/sys/netpfil/pf/pf_syncookies.c
--- a/sys/netpfil/pf/pf_syncookies.c
+++ b/sys/netpfil/pf/pf_syncookies.c
@@ -201,9 +201,6 @@
return (ENOMEM);
nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK);
- if (nvlpacked == NULL)
- return (ENOMEM);
-
error = copyin(nv->data, nvlpacked, nv->len);
if (error)
ERROUT(error);
diff --git a/sys/netsmb/smb_rq.c b/sys/netsmb/smb_rq.c
--- a/sys/netsmb/smb_rq.c
+++ b/sys/netsmb/smb_rq.c
@@ -64,8 +64,6 @@
int error;
rqp = malloc(sizeof(*rqp), M_SMBRQ, M_WAITOK);
- if (rqp == NULL)
- return ENOMEM;
error = smb_rq_init(rqp, layer, cmd, scred);
rqp->sr_flags |= SMBR_ALLOCED;
if (error) {
@@ -376,8 +374,6 @@
int error;
t2p = malloc(sizeof(*t2p), M_SMBRQ, M_WAITOK);
- if (t2p == NULL)
- return ENOMEM;
error = smb_t2_init(t2p, layer, setup, scred);
t2p->t2_flags |= SMBT2_ALLOCED;
if (error) {
diff --git a/sys/netsmb/smb_subr.c b/sys/netsmb/smb_subr.c
--- a/sys/netsmb/smb_subr.c
+++ b/sys/netsmb/smb_subr.c
@@ -149,8 +149,6 @@
if (len > 8 * 1024)
return NULL;
p = malloc(len, M_SMBSTR, M_WAITOK);
- if (p == NULL)
- return NULL;
bcopy(umem, p, len);
return p;
}
diff --git a/sys/tests/framework/kern_testfrwk.c b/sys/tests/framework/kern_testfrwk.c
--- a/sys/tests/framework/kern_testfrwk.c
+++ b/sys/tests/framework/kern_testfrwk.c
@@ -192,10 +192,6 @@
}
/* Grab some memory */
kte = malloc(sizeof(struct kern_test_entry), M_KTFRWK, M_WAITOK);
- if (kte == NULL) {
- error = ENOMEM;
- goto out;
- }
KTFRWK_LOCK();
TAILQ_FOREACH(li, &kfrwk.kfrwk_testlist, next) {
if (strcmp(li->name, kt.name) == 0) {
@@ -244,10 +240,6 @@
return (E2BIG);
}
te = malloc(sizeof(struct kern_test_list), M_KTFRWK, M_WAITOK);
- if (te == NULL) {
- error = ENOMEM;
- goto out;
- }
KTFRWK_LOCK();
/* First does it already exist? */
TAILQ_FOREACH(li, &kfrwk.kfrwk_testlist, next) {
diff --git a/sys/xdr/xdr_sizeof.c b/sys/xdr/xdr_sizeof.c
--- a/sys/xdr/xdr_sizeof.c
+++ b/sys/xdr/xdr_sizeof.c
@@ -94,10 +94,7 @@
/* Free the earlier space and allocate new area */
if (xdrs->x_private)
free(xdrs->x_private, M_RPC);
- if ((xdrs->x_private = (caddr_t) malloc(len, M_RPC, M_WAITOK)) == NULL) {
- xdrs->x_base = 0;
- return (NULL);
- }
+ xdrs->x_private = (caddr_t) malloc(len, M_RPC, M_WAITOK);
xdrs->x_base = (caddr_t)(uintptr_t) len;
xdrs->x_handy += len;
return ((int32_t *) xdrs->x_private);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Feb 7, 6:58 AM (21 h, 43 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16495545
Default Alt Text
D45852.id140554.diff (50 KB)
Attached To
Mode
D45852: Stop checking for failures from malloc(M_WAITOK)
Attached
Detach File
Event Timeline
Log In to Comment