View | Details | Raw Unified | Return to bug 240545 | Differences between
and this patch

Collapse All | Expand All

(-)arm/mv/gpio.c (-4 lines)
Lines 720-729 Link Here
720
720
721
	sd = (struct mv_gpio_pindev *)malloc(sizeof(struct mv_gpio_pindev),
721
	sd = (struct mv_gpio_pindev *)malloc(sizeof(struct mv_gpio_pindev),
722
	    M_DEVBUF, M_WAITOK);
722
	    M_DEVBUF, M_WAITOK);
723
	if (sd == NULL) {
724
		mv_gpio_int_ack(&s);
725
		return;
726
	}
727
	sd->pin = pin;
723
	sd->pin = pin;
728
	sd->dev = dev;
724
	sd->dev = dev;
729
725
(-)cam/ctl/ctl.c (-6 lines)
Lines 2640-2651 Link Here
2640
		}
2640
		}
2641
2641
2642
		entries = malloc(ooa_hdr->alloc_len, M_CTL, M_WAITOK | M_ZERO);
2642
		entries = malloc(ooa_hdr->alloc_len, M_CTL, M_WAITOK | M_ZERO);
2643
		if (entries == NULL) {
2644
			printf("%s: could not allocate %d bytes for OOA "
2645
			       "dump\n", __func__, ooa_hdr->alloc_len);
2646
			retval = ENOMEM;
2647
			break;
2648
		}
2649
2643
2650
		mtx_lock(&softc->ctl_lock);
2644
		mtx_lock(&softc->ctl_lock);
2651
		if ((ooa_hdr->flags & CTL_OOA_FLAG_ALL_LUNS) == 0 &&
2645
		if ((ooa_hdr->flags & CTL_OOA_FLAG_ALL_LUNS) == 0 &&
(-)compat/linuxkpi/common/src/linux_usb.c (-9 / +7 lines)
Lines 1008-1023 Link Here
1008
	}
1008
	}
1009
1009
1010
	urb = malloc(size, M_USBDEV, M_WAITOK | M_ZERO);
1010
	urb = malloc(size, M_USBDEV, M_WAITOK | M_ZERO);
1011
	if (urb) {
1012
1011
1013
		cv_init(&urb->cv_wait, "URBWAIT");
1012
	cv_init(&urb->cv_wait, "URBWAIT");
1014
		if (iso_packets == 0xFFFF) {
1013
	if (iso_packets == 0xFFFF) {
1015
			urb->setup_packet = (void *)(urb + 1);
1014
		urb->setup_packet = (void *)(urb + 1);
1016
			urb->transfer_buffer = (void *)(urb->setup_packet +
1015
		urb->transfer_buffer = (void *)(urb->setup_packet +
1017
			    sizeof(struct usb_device_request));
1016
						sizeof(struct usb_device_request));
1018
		} else {
1017
	} else {
1019
			urb->number_of_packets = iso_packets;
1018
		urb->number_of_packets = iso_packets;
1020
		}
1021
	}
1019
	}
1022
	return (urb);
1020
	return (urb);
1023
}
1021
}
(-)contrib/rdma/krping/krping_dev.c (-4 lines)
Lines 174-183 Link Here
174
	krping_t *krpingmsg;
174
	krping_t *krpingmsg;
175
175
176
	krpingmsg = malloc(sizeof *krpingmsg, M_DEVBUF, M_WAITOK|M_ZERO);
176
	krpingmsg = malloc(sizeof *krpingmsg, M_DEVBUF, M_WAITOK|M_ZERO);
177
	if (!krpingmsg) {
178
		uprintf("Could not malloc mem!\n");
179
		return ENOMEM;
180
	}
181
177
182
	cp = krpingmsg->msg;
178
	cp = krpingmsg->msg;
183
	while (uio->uio_resid) {
179
	while (uio->uio_resid) {
(-)dev/ath/if_ath_lna_div.c (-6 lines)
Lines 100-111 Link Here
100
100
101
	ss = malloc(sizeof(struct if_ath_ant_comb_state),
101
	ss = malloc(sizeof(struct if_ath_ant_comb_state),
102
	    M_TEMP, M_WAITOK | M_ZERO);
102
	    M_TEMP, M_WAITOK | M_ZERO);
103
	if (ss == NULL) {
104
		device_printf(sc->sc_dev, "%s: failed to allocate\n",
105
		    __func__);
106
		/* Don't fail at this point */
107
		return (0);
108
	}
109
103
110
	/* Fetch the hardware configuration */
104
	/* Fetch the hardware configuration */
111
	OS_MEMZERO(&div_ant_conf, sizeof(div_ant_conf));
105
	OS_MEMZERO(&div_ant_conf, sizeof(div_ant_conf));
(-)dev/ath/if_ath_spectral.c (-6 lines)
Lines 117-128 Link Here
117
	ss = malloc(sizeof(struct ath_spectral_state),
117
	ss = malloc(sizeof(struct ath_spectral_state),
118
	    M_TEMP, M_WAITOK | M_ZERO);
118
	    M_TEMP, M_WAITOK | M_ZERO);
119
119
120
	if (ss == NULL) {
121
		device_printf(sc->sc_dev, "%s: failed to alloc memory\n",
122
		    __func__);
123
		return (-ENOMEM);
124
	}
125
126
	sc->sc_spectral = ss;
120
	sc->sc_spectral = ss;
127
121
128
	(void) ath_hal_spectral_get_config(sc->sc_ah, &ss->spectral_state);
122
	(void) ath_hal_spectral_get_config(sc->sc_ah, &ss->spectral_state);
(-)dev/cxgbe/t4_main.c (-16 lines)
Lines 9508-9517 Link Here
9508
	}
9508
	}
9509
9509
9510
	fw_data = malloc(fw->len, M_CXGBE, M_WAITOK);
9510
	fw_data = malloc(fw->len, M_CXGBE, M_WAITOK);
9511
	if (fw_data == NULL) {
9512
		rc = ENOMEM;
9513
		goto done;
9514
	}
9515
9511
9516
	rc = copyin(fw->data, fw_data, fw->len);
9512
	rc = copyin(fw->data, fw_data, fw->len);
9517
	if (rc == 0)
9513
	if (rc == 0)
Lines 9540-9549 Link Here
9540
	}
9536
	}
9541
9537
9542
	cfg_data = malloc(cfg->len, M_CXGBE, M_WAITOK);
9538
	cfg_data = malloc(cfg->len, M_CXGBE, M_WAITOK);
9543
	if (cfg_data == NULL) {
9544
		rc = ENOMEM;
9545
		goto done;
9546
	}
9547
9539
9548
	rc = copyin(cfg->data, cfg_data, cfg->len);
9540
	rc = copyin(cfg->data, cfg_data, cfg->len);
9549
	if (rc == 0)
9541
	if (rc == 0)
Lines 9589-9598 Link Here
9589
	}
9581
	}
9590
9582
9591
	br_data = malloc(br->len, M_CXGBE, M_WAITOK);
9583
	br_data = malloc(br->len, M_CXGBE, M_WAITOK);
9592
	if (br_data == NULL) {
9593
		rc = ENOMEM;
9594
		goto done;
9595
	}
9596
9584
9597
	rc = copyin(br->data, br_data, br->len);
9585
	rc = copyin(br->data, br_data, br->len);
9598
	if (rc == 0)
9586
	if (rc == 0)
Lines 9621-9630 Link Here
9621
	}
9609
	}
9622
9610
9623
	bc_data = malloc(bc->len, M_CXGBE, M_WAITOK);
9611
	bc_data = malloc(bc->len, M_CXGBE, M_WAITOK);
9624
	if (bc_data == NULL) {
9625
		rc = ENOMEM;
9626
		goto done;
9627
	}
9628
9612
9629
	rc = copyin(bc->data, bc_data, bc->len);
9613
	rc = copyin(bc->data, bc_data, bc->len);
9630
	if (rc == 0)
9614
	if (rc == 0)
(-)dev/drm2/drm_crtc.c (-14 lines)
Lines 1999-2008 Link Here
1999
		connector_set = malloc(crtc_req->count_connectors *
1999
		connector_set = malloc(crtc_req->count_connectors *
2000
					sizeof(struct drm_connector *),
2000
					sizeof(struct drm_connector *),
2001
					DRM_MEM_KMS, M_WAITOK);
2001
					DRM_MEM_KMS, M_WAITOK);
2002
		if (!connector_set) {
2003
			ret = -ENOMEM;
2004
			goto out;
2005
		}
2006
2002
2007
		for (i = 0; i < crtc_req->count_connectors; i++) {
2003
		for (i = 0; i < crtc_req->count_connectors; i++) {
2008
			set_connectors_ptr = (uint32_t __user *)(unsigned long)crtc_req->set_connectors_ptr;
2004
			set_connectors_ptr = (uint32_t __user *)(unsigned long)crtc_req->set_connectors_ptr;
Lines 2524-2533 Link Here
2524
		}
2520
		}
2525
		clips = malloc(num_clips * sizeof(*clips), DRM_MEM_KMS,
2521
		clips = malloc(num_clips * sizeof(*clips), DRM_MEM_KMS,
2526
		    M_WAITOK | M_ZERO);
2522
		    M_WAITOK | M_ZERO);
2527
		if (!clips) {
2528
			ret = -ENOMEM;
2529
			goto out_err1;
2530
		}
2531
2523
2532
		ret = copy_from_user(clips, clips_ptr,
2524
		ret = copy_from_user(clips, clips_ptr,
2533
				     num_clips * sizeof(*clips));
2525
				     num_clips * sizeof(*clips));
Lines 3633-3644 Link Here
3633
		mtx_unlock(&dev->event_lock);
3625
		mtx_unlock(&dev->event_lock);
3634
3626
3635
		e = malloc(sizeof *e, DRM_MEM_KMS, M_WAITOK | M_ZERO);
3627
		e = malloc(sizeof *e, DRM_MEM_KMS, M_WAITOK | M_ZERO);
3636
		if (e == NULL) {
3637
			mtx_lock(&dev->event_lock);
3638
			file_priv->event_space += sizeof e->event;
3639
			mtx_unlock(&dev->event_lock);
3640
			goto out;
3641
		}
3642
3628
3643
		e->event.base.type = DRM_EVENT_FLIP_COMPLETE;
3629
		e->event.base.type = DRM_EVENT_FLIP_COMPLETE;
3644
		e->event.base.length = sizeof e->event;
3630
		e->event.base.length = sizeof e->event;
(-)dev/hpt27xx/hpt27xx_osm_bsd.c (-4 lines)
Lines 111-120 Link Here
111
	if (!ldm_register_adapter(&hba->ldm_adapter)) {
111
	if (!ldm_register_adapter(&hba->ldm_adapter)) {
112
		size = ldm_get_vbus_size();
112
		size = ldm_get_vbus_size();
113
		vbus_ext = malloc(sizeof(VBUS_EXT) + size, M_DEVBUF, M_WAITOK);
113
		vbus_ext = malloc(sizeof(VBUS_EXT) + size, M_DEVBUF, M_WAITOK);
114
		if (!vbus_ext) {
115
			free(hba->ldm_adapter.him_handle, M_DEVBUF);
116
			return ENXIO;
117
		}
118
		memset(vbus_ext, 0, sizeof(VBUS_EXT));
114
		memset(vbus_ext, 0, sizeof(VBUS_EXT));
119
		vbus_ext->ext_type = EXT_TYPE_VBUS;
115
		vbus_ext->ext_type = EXT_TYPE_VBUS;
120
		ldm_create_vbus((PVBUS)vbus_ext->vbus, vbus_ext);
116
		ldm_create_vbus((PVBUS)vbus_ext->vbus, vbus_ext);
(-)dev/hptmv/entry.c (-10 / +4 lines)
Lines 2008-2023 Link Here
2008
	}
2008
	}
2009
2009
2010
2010
2011
	if((ccb = (union ccb *)malloc(sizeof(*ccb), M_DEVBUF, M_WAITOK)) != (union ccb*)NULL)
2011
	ccb = (union ccb *)malloc(sizeof(*ccb), M_DEVBUF, M_WAITOK);
2012
	{
2012
	bzero(ccb, sizeof(*ccb));
2013
		bzero(ccb, sizeof(*ccb));
2013
	ccb->ccb_h.pinfo.priority = 1;
2014
		ccb->ccb_h.pinfo.priority = 1;
2014
	ccb->ccb_h.pinfo.index = CAM_UNQUEUED_INDEX;
2015
		ccb->ccb_h.pinfo.index = CAM_UNQUEUED_INDEX;
2016
	}
2017
	else
2018
	{
2019
		return ENOMEM;
2020
	}
2021
	/*
2015
	/*
2022
	 * Create the device queue for our SIM(s).
2016
	 * Create the device queue for our SIM(s).
2023
	 */
2017
	 */
(-)dev/iser/iser_verbs.c (-4 lines)
Lines 344-353 Link Here
344
	int ret;
344
	int ret;
345
345
346
	desc = malloc(sizeof(*desc), M_ISER_VERBS, M_WAITOK | M_ZERO);
346
	desc = malloc(sizeof(*desc), M_ISER_VERBS, M_WAITOK | M_ZERO);
347
	if (!desc) {
348
		ISER_ERR("Failed to allocate a new fastreg descriptor");
349
		return (NULL);
350
	}
351
347
352
	ret = iser_alloc_reg_res(ib_device, pd, &desc->rsc);
348
	ret = iser_alloc_reg_res(ib_device, pd, &desc->rsc);
353
	if (ret) {
349
	if (ret) {
(-)dev/ixl/ixl_pf_main.c (-5 lines)
Lines 4786-4795 Link Here
4786
	/* This amount is only necessary if reading the entire cluster into memory */
4786
	/* This amount is only necessary if reading the entire cluster into memory */
4787
#define IXL_FINAL_BUFF_SIZE	(1280 * 1024)
4787
#define IXL_FINAL_BUFF_SIZE	(1280 * 1024)
4788
	final_buff = malloc(IXL_FINAL_BUFF_SIZE, M_DEVBUF, M_WAITOK);
4788
	final_buff = malloc(IXL_FINAL_BUFF_SIZE, M_DEVBUF, M_WAITOK);
4789
	if (final_buff == NULL) {
4790
		device_printf(dev, "Could not allocate memory for output.\n");
4791
		goto out;
4792
	}
4793
	int final_buff_len = 0;
4789
	int final_buff_len = 0;
4794
4790
4795
	u8 cluster_id = 1;
4791
	u8 cluster_id = 1;
Lines 4848-4854 Link Here
4848
4844
4849
free_out:
4845
free_out:
4850
	free(final_buff, M_DEVBUF);
4846
	free(final_buff, M_DEVBUF);
4851
out:
4852
	error = sbuf_finish(buf);
4847
	error = sbuf_finish(buf);
4853
	if (error)
4848
	if (error)
4854
		device_printf(dev, "Error finishing sbuf: %d\n", error);
4849
		device_printf(dev, "Error finishing sbuf: %d\n", error);
(-)dev/mfi/mfi.c (-5 / +3 lines)
Lines 3638-3648 Link Here
3638
		mfi_aen_entry = malloc(sizeof(struct mfi_aen), M_MFIBUF,
3638
		mfi_aen_entry = malloc(sizeof(struct mfi_aen), M_MFIBUF,
3639
		    M_WAITOK);
3639
		    M_WAITOK);
3640
		mtx_lock(&sc->mfi_io_lock);
3640
		mtx_lock(&sc->mfi_io_lock);
3641
		if (mfi_aen_entry != NULL) {
3641
		mfi_aen_entry->p = curproc;
3642
			mfi_aen_entry->p = curproc;
3642
		TAILQ_INSERT_TAIL(&sc->mfi_aen_pids, mfi_aen_entry,
3643
			TAILQ_INSERT_TAIL(&sc->mfi_aen_pids, mfi_aen_entry,
3643
				  aen_link);
3644
			    aen_link);
3645
		}
3646
		error = mfi_aen_register(sc, l_aen.laen_seq_num,
3644
		error = mfi_aen_register(sc, l_aen.laen_seq_num,
3647
		    l_aen.laen_class_locale);
3645
		    l_aen.laen_class_locale);
3648
3646
(-)dev/mlx/mlx.c (-2 / +3 lines)
Lines 2079-2086 Link Here
2079
	    goto out;
2079
	    goto out;
2080
	}
2080
	}
2081
	MLX_IO_UNLOCK(sc);
2081
	MLX_IO_UNLOCK(sc);
2082
	if (((kbuf = malloc(mu->mu_datasize, M_DEVBUF, M_WAITOK)) == NULL) ||
2082
	kbuf = malloc(mu->mu_datasize, M_DEVBUF, M_WAITOK);
2083
	    (error = copyin(mu->mu_buf, kbuf, mu->mu_datasize))) {
2083
	error = copyin(mu->mu_buf, kbuf, mu->mu_datasize);
2084
	if (error) {
2084
	    MLX_IO_LOCK(sc);
2085
	    MLX_IO_LOCK(sc);
2085
	    goto out;
2086
	    goto out;
2086
	}
2087
	}
(-)dev/mpr/mpr.c (-5 lines)
Lines 2716-2726 Link Here
2716
	int error = 0;
2716
	int error = 0;
2717
2717
2718
	eh = malloc(sizeof(struct mpr_event_handle), M_MPR, M_WAITOK|M_ZERO);
2718
	eh = malloc(sizeof(struct mpr_event_handle), M_MPR, M_WAITOK|M_ZERO);
2719
	if (!eh) {
2720
		mpr_dprint(sc, MPR_EVENT|MPR_ERROR,
2721
		    "Cannot allocate event memory\n");
2722
		return (ENOMEM);
2723
	}
2724
	eh->callback = cb;
2719
	eh->callback = cb;
2725
	eh->data = data;
2720
	eh->data = data;
2726
	TAILQ_INSERT_TAIL(&sc->event_list, eh, eh_list);
2721
	TAILQ_INSERT_TAIL(&sc->event_list, eh, eh_list);
(-)dev/mpr/mpr_sas.c (-5 lines)
Lines 745-755 Link Here
745
	mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__);
745
	mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__);
746
746
747
	sassc = malloc(sizeof(struct mprsas_softc), M_MPR, M_WAITOK|M_ZERO);
747
	sassc = malloc(sizeof(struct mprsas_softc), M_MPR, M_WAITOK|M_ZERO);
748
	if (!sassc) {
749
		mpr_dprint(sc, MPR_INIT|MPR_ERROR,
750
		    "Cannot allocate SAS subsystem memory\n");
751
		return (ENOMEM);
752
	}
753
748
754
	/*
749
	/*
755
	 * XXX MaxTargets could change during a reinit.  Since we don't
750
	 * XXX MaxTargets could change during a reinit.  Since we don't
(-)dev/mpr/mpr_user.c (-7 lines)
Lines 1542-1554 Link Here
1542
	bzero(sc->fw_diag_buffer, buffer_size);
1542
	bzero(sc->fw_diag_buffer, buffer_size);
1543
1543
1544
	ctx = malloc(sizeof(*ctx), M_MPR, M_WAITOK | M_ZERO);
1544
	ctx = malloc(sizeof(*ctx), M_MPR, M_WAITOK | M_ZERO);
1545
	if (ctx == NULL) {
1546
		device_printf(sc->mpr_dev, "%s: context malloc failed\n",
1547
		    __func__);
1548
		*return_code = MPR_FW_DIAG_ERROR_NO_BUFFER;
1549
		status = MPR_DIAG_FAILURE;
1550
		goto bailout;
1551
	}
1552
	ctx->addr = &sc->fw_diag_busaddr;
1545
	ctx->addr = &sc->fw_diag_busaddr;
1553
	ctx->buffer_dmat = sc->fw_diag_dmat;
1546
	ctx->buffer_dmat = sc->fw_diag_dmat;
1554
	ctx->buffer_dmamap = sc->fw_diag_map;
1547
	ctx->buffer_dmamap = sc->fw_diag_map;
(-)dev/mps/mps.c (-4 lines)
Lines 2584-2593 Link Here
2584
	int error = 0;
2584
	int error = 0;
2585
2585
2586
	eh = malloc(sizeof(struct mps_event_handle), M_MPT2, M_WAITOK|M_ZERO);
2586
	eh = malloc(sizeof(struct mps_event_handle), M_MPT2, M_WAITOK|M_ZERO);
2587
	if(!eh) {
2588
		mps_dprint(sc, MPS_ERROR, "Cannot allocate event memory\n");
2589
		return (ENOMEM);
2590
	}
2591
	eh->callback = cb;
2587
	eh->callback = cb;
2592
	eh->data = data;
2588
	eh->data = data;
2593
	TAILQ_INSERT_TAIL(&sc->event_list, eh, eh_list);
2589
	TAILQ_INSERT_TAIL(&sc->event_list, eh, eh_list);
(-)dev/mps/mps_sas.c (-5 lines)
Lines 727-737 Link Here
727
	mps_dprint(sc, MPS_INIT, "%s entered\n", __func__);
727
	mps_dprint(sc, MPS_INIT, "%s entered\n", __func__);
728
728
729
	sassc = malloc(sizeof(struct mpssas_softc), M_MPT2, M_WAITOK|M_ZERO);
729
	sassc = malloc(sizeof(struct mpssas_softc), M_MPT2, M_WAITOK|M_ZERO);
730
	if(!sassc) {
731
		mps_dprint(sc, MPS_INIT|MPS_ERROR,
732
		    "Cannot allocate SAS controller memory\n");
733
		return (ENOMEM);
734
	}
735
730
736
	/*
731
	/*
737
	 * XXX MaxTargets could change during a reinit.  Since we don't
732
	 * XXX MaxTargets could change during a reinit.  Since we don't
(-)dev/mps/mps_user.c (-7 lines)
Lines 1445-1457 Link Here
1445
        bzero(sc->fw_diag_buffer, buffer_size);
1445
        bzero(sc->fw_diag_buffer, buffer_size);
1446
1446
1447
	ctx = malloc(sizeof(*ctx), M_MPSUSER, M_WAITOK | M_ZERO);
1447
	ctx = malloc(sizeof(*ctx), M_MPSUSER, M_WAITOK | M_ZERO);
1448
	if (ctx == NULL) {
1449
		device_printf(sc->mps_dev, "%s: context malloc failed\n",
1450
		    __func__);
1451
		*return_code = MPS_FW_DIAG_ERROR_NO_BUFFER;
1452
		status = MPS_DIAG_FAILURE;
1453
		goto bailout;
1454
	}
1455
	ctx->addr = &sc->fw_diag_busaddr;
1448
	ctx->addr = &sc->fw_diag_busaddr;
1456
	ctx->buffer_dmat = sc->fw_diag_dmat;
1449
	ctx->buffer_dmat = sc->fw_diag_dmat;
1457
	ctx->buffer_dmamap = sc->fw_diag_map;
1450
	ctx->buffer_dmamap = sc->fw_diag_map;
(-)dev/ntb/test/ntb_tool.c (-4 lines)
Lines 619-628 Link Here
619
write:
619
write:
620
	data_buf_size = *buf_size;
620
	data_buf_size = *buf_size;
621
	data_buf = malloc(data_buf_size, M_NTB_TOOL, M_WAITOK | M_ZERO);
621
	data_buf = malloc(data_buf_size, M_NTB_TOOL, M_WAITOK | M_ZERO);
622
	if (!data_buf) {
623
		rc = ENOMEM;
624
		goto out;
625
	}
626
622
627
	if (s_pflag)
623
	if (s_pflag)
628
		memset(data_buf, pattern, data_buf_size);
624
		memset(data_buf, pattern, data_buf_size);
(-)dev/nvme/nvme_ns.c (-4 lines)
Lines 473-482 Link Here
473
		dsm_range =
473
		dsm_range =
474
		    malloc(sizeof(struct nvme_dsm_range), M_NVME,
474
		    malloc(sizeof(struct nvme_dsm_range), M_NVME,
475
		    M_ZERO | M_WAITOK);
475
		    M_ZERO | M_WAITOK);
476
		if (!dsm_range) {
477
			err = ENOMEM;
478
			break;
479
		}
480
		dsm_range->length =
476
		dsm_range->length =
481
		    htole32(bp->bio_bcount/nvme_ns_get_sector_size(ns));
477
		    htole32(bp->bio_bcount/nvme_ns_get_sector_size(ns));
482
		dsm_range->starting_lba =
478
		dsm_range->starting_lba =
(-)dev/pms/freebsd/driver/ini/src/agtiapi.c (-7 lines)
Lines 319-331 Link Here
319
                             sizeof(void *) );
319
                             sizeof(void *) );
320
  AGTIAPI_PRINTK("agtiapi_getdevlist: portCount %d\n", pCard->portCount);
320
  AGTIAPI_PRINTK("agtiapi_getdevlist: portCount %d\n", pCard->portCount);
321
  devList = malloc(memNeeded1, TEMP2, M_WAITOK); 
321
  devList = malloc(memNeeded1, TEMP2, M_WAITOK); 
322
  if (devList == NULL)
323
  {
324
    AGTIAPI_PRINTK("agtiapi_getdevlist: failed to allocate memory\n");
325
    ret_val = IOCTL_CALL_FAIL;
326
    agIOCTLPayload->Status = IOCTL_ERR_STATUS_INTERNAL_ERROR;
327
    return ret_val;
328
  }
329
  osti_memset(devList, 0,  memNeeded1);
322
  osti_memset(devList, 0,  memNeeded1);
330
  pPortalData = &pCard->pPortalData[0];
323
  pPortalData = &pCard->pPortalData[0];
331
  pDeviceHandleList = (bit8*)devList;
324
  pDeviceHandleList = (bit8*)devList;
(-)dev/sound/usb/uaudio.c (-4 lines)
Lines 4986-4995 Link Here
4986
	iot = malloc(sizeof(struct uaudio_terminal_node) * 256, M_TEMP,
4986
	iot = malloc(sizeof(struct uaudio_terminal_node) * 256, M_TEMP,
4987
	    M_WAITOK | M_ZERO);
4987
	    M_WAITOK | M_ZERO);
4988
4988
4989
	if (iot == NULL) {
4990
		DPRINTF("no memory!\n");
4991
		goto done;
4992
	}
4993
	while ((desc = usb_desc_foreach(cd, desc))) {
4989
	while ((desc = usb_desc_foreach(cd, desc))) {
4994
4990
4995
		dp = desc;
4991
		dp = desc;
(-)dev/usb/input/uhid.c (-8 lines)
Lines 450-459 Link Here
450
450
451
	if (kern_data == NULL) {
451
	if (kern_data == NULL) {
452
		kern_data = malloc(len, M_USBDEV, M_WAITOK);
452
		kern_data = malloc(len, M_USBDEV, M_WAITOK);
453
		if (kern_data == NULL) {
454
			err = ENOMEM;
455
			goto done;
456
		}
457
		free_data = 1;
453
		free_data = 1;
458
	}
454
	}
459
	err = usbd_req_get_report(sc->sc_udev, NULL, kern_data,
455
	err = usbd_req_get_report(sc->sc_udev, NULL, kern_data,
Lines 486-495 Link Here
486
482
487
	if (kern_data == NULL) {
483
	if (kern_data == NULL) {
488
		kern_data = malloc(len, M_USBDEV, M_WAITOK);
484
		kern_data = malloc(len, M_USBDEV, M_WAITOK);
489
		if (kern_data == NULL) {
490
			err = ENOMEM;
491
			goto done;
492
		}
493
		free_data = 1;
485
		free_data = 1;
494
		err = copyin(user_data, kern_data, len);
486
		err = copyin(user_data, kern_data, len);
495
		if (err) {
487
		if (err) {
(-)dev/usb/input/uhid_snes.c (-8 lines)
Lines 168-177 Link Here
168
168
169
	if (kern_data == NULL) {
169
	if (kern_data == NULL) {
170
		kern_data = malloc(len, M_USBDEV, M_WAITOK);
170
		kern_data = malloc(len, M_USBDEV, M_WAITOK);
171
		if (kern_data == NULL) {
172
			err = ENOMEM;
173
			goto done;
174
		}
175
		free_data = 1;
171
		free_data = 1;
176
	}
172
	}
177
	err = usbd_req_get_report(sc->sc_udev, NULL, kern_data,
173
	err = usbd_req_get_report(sc->sc_udev, NULL, kern_data,
Lines 203-212 Link Here
203
199
204
	if (kern_data == NULL) {
200
	if (kern_data == NULL) {
205
		kern_data = malloc(len, M_USBDEV, M_WAITOK);
201
		kern_data = malloc(len, M_USBDEV, M_WAITOK);
206
		if (kern_data == NULL) {
207
			err = ENOMEM;
208
			goto done;
209
		}
210
		free_data = 1;
202
		free_data = 1;
211
		err = copyin(user_data, kern_data, len);
203
		err = copyin(user_data, kern_data, len);
212
		if (err) {
204
		if (err) {
(-)dev/usb/storage/ustorage_fs.c (-4 lines)
Lines 380-389 Link Here
380
			ustorage_fs_ramdisk =
380
			ustorage_fs_ramdisk =
381
			    malloc(USTORAGE_FS_RAM_SECT << 9, M_USB,
381
			    malloc(USTORAGE_FS_RAM_SECT << 9, M_USB,
382
			    M_ZERO | M_WAITOK);
382
			    M_ZERO | M_WAITOK);
383
384
			if (ustorage_fs_ramdisk == NULL) {
385
				return (ENOMEM);
386
			}
387
		}
383
		}
388
		sc->sc_lun[0].memory_image = ustorage_fs_ramdisk;
384
		sc->sc_lun[0].memory_image = ustorage_fs_ramdisk;
389
		sc->sc_lun[0].num_sectors = USTORAGE_FS_RAM_SECT;
385
		sc->sc_lun[0].num_sectors = USTORAGE_FS_RAM_SECT;
(-)dev/usb/usb_dev.c (-10 / +5 lines)
Lines 385-397 Link Here
385
	struct usb_fifo *f;
385
	struct usb_fifo *f;
386
386
387
	f = malloc(sizeof(*f), M_USBDEV, M_WAITOK | M_ZERO);
387
	f = malloc(sizeof(*f), M_USBDEV, M_WAITOK | M_ZERO);
388
	if (f != NULL) {
388
	cv_init(&f->cv_io, "FIFO-IO");
389
		cv_init(&f->cv_io, "FIFO-IO");
389
	cv_init(&f->cv_drain, "FIFO-DRAIN");
390
		cv_init(&f->cv_drain, "FIFO-DRAIN");
390
	f->priv_mtx = mtx;
391
		f->priv_mtx = mtx;
391
	f->refcount = 1;
392
		f->refcount = 1;
392
	knlist_init_mtx(&f->selinfo.si_note, mtx);
393
		knlist_init_mtx(&f->selinfo.si_note, mtx);
394
	}
395
	return (f);
393
	return (f);
396
}
394
}
397
395
Lines 2308-2316 Link Here
2308
	struct usb_symlink *ps;
2306
	struct usb_symlink *ps;
2309
2307
2310
	ps = malloc(sizeof(*ps), M_USBDEV, M_WAITOK);
2308
	ps = malloc(sizeof(*ps), M_USBDEV, M_WAITOK);
2311
	if (ps == NULL) {
2312
		return (ps);
2313
	}
2314
	/* XXX no longer needed */
2309
	/* XXX no longer needed */
2315
	strlcpy(ps->src_path, target, sizeof(ps->src_path));
2310
	strlcpy(ps->src_path, target, sizeof(ps->src_path));
2316
	ps->src_len = strlen(ps->src_path);
2311
	ps->src_len = strlen(ps->src_path);
(-)dev/usb/usb_device.c (-3 lines)
Lines 1709-1717 Link Here
1709
		return (NULL);
1709
		return (NULL);
1710
	}
1710
	}
1711
	udev = malloc(sizeof(*udev), M_USB, M_WAITOK | M_ZERO);
1711
	udev = malloc(sizeof(*udev), M_USB, M_WAITOK | M_ZERO);
1712
	if (udev == NULL) {
1713
		return (NULL);
1714
	}
1715
	/* initialise our SX-lock */
1712
	/* initialise our SX-lock */
1716
	sx_init_flags(&udev->enum_sx, "USB config SX lock", SX_DUPOK);
1713
	sx_init_flags(&udev->enum_sx, "USB config SX lock", SX_DUPOK);
1717
	sx_init_flags(&udev->sr_sx, "USB suspend and resume SX lock", SX_NOWITNESS);
1714
	sx_init_flags(&udev->sr_sx, "USB suspend and resume SX lock", SX_NOWITNESS);
(-)dev/usb/usb_mbuf.c (-6 lines)
Lines 78-92 Link Here
78
		alloc_size = (block_size + sizeof(struct usb_mbuf)) * nblocks;
78
		alloc_size = (block_size + sizeof(struct usb_mbuf)) * nblocks;
79
79
80
		free_ptr = malloc(alloc_size, type, M_WAITOK | M_ZERO);
80
		free_ptr = malloc(alloc_size, type, M_WAITOK | M_ZERO);
81
82
		if (free_ptr == NULL) {
83
			goto done;
84
		}
85
		m_ptr = free_ptr;
81
		m_ptr = free_ptr;
86
		data_ptr = (void *)(m_ptr + nblocks);
82
		data_ptr = (void *)(m_ptr + nblocks);
87
83
88
		while (nblocks--) {
84
		while (nblocks--) {
89
90
			m_ptr->cur_data_ptr =
85
			m_ptr->cur_data_ptr =
91
			    m_ptr->min_data_ptr = data_ptr;
86
			    m_ptr->min_data_ptr = data_ptr;
92
87
Lines 99-104 Link Here
99
			data_ptr += block_size;
94
			data_ptr += block_size;
100
		}
95
		}
101
	}
96
	}
102
done:
103
	return (free_ptr);
97
	return (free_ptr);
104
}
98
}
(-)dev/usb/usb_transfer.c (-7 lines)
Lines 1268-1280 Link Here
1268
		/* allocate zeroed memory */
1268
		/* allocate zeroed memory */
1269
		buf = malloc(parm->size[0], M_USB, M_WAITOK | M_ZERO);
1269
		buf = malloc(parm->size[0], M_USB, M_WAITOK | M_ZERO);
1270
1270
1271
		if (buf == NULL) {
1272
			parm->err = USB_ERR_NOMEM;
1273
			DPRINTFN(0, "cannot allocate memory block for "
1274
			    "configuration (%d bytes)\n",
1275
			    parm->size[0]);
1276
			goto done;
1277
		}
1278
		parm->dma_tag_p = USB_ADD_BYTES(buf, parm->size[1]);
1271
		parm->dma_tag_p = USB_ADD_BYTES(buf, parm->size[1]);
1279
		parm->dma_page_ptr = USB_ADD_BYTES(buf, parm->size[3]);
1272
		parm->dma_page_ptr = USB_ADD_BYTES(buf, parm->size[3]);
1280
		parm->dma_page_cache_ptr = USB_ADD_BYTES(buf, parm->size[4]);
1273
		parm->dma_page_cache_ptr = USB_ADD_BYTES(buf, parm->size[4]);
(-)fs/cuse/cuse.c (-9 lines)
Lines 1205-1214 Link Here
1205
1205
1206
		pcsd = malloc(sizeof(*pcsd), M_CUSE, M_WAITOK | M_ZERO);
1206
		pcsd = malloc(sizeof(*pcsd), M_CUSE, M_WAITOK | M_ZERO);
1207
1207
1208
		if (pcsd == NULL) {
1209
			error = ENOMEM;
1210
			break;
1211
		}
1212
		pcsd->server = pcs;
1208
		pcsd->server = pcs;
1213
1209
1214
		pcsd->user_dev = pcd->dev;
1210
		pcsd->user_dev = pcd->dev;
Lines 1420-1430 Link Here
1420
		return (EINVAL);
1416
		return (EINVAL);
1421
1417
1422
	pcc = malloc(sizeof(*pcc), M_CUSE, M_WAITOK | M_ZERO);
1418
	pcc = malloc(sizeof(*pcc), M_CUSE, M_WAITOK | M_ZERO);
1423
	if (pcc == NULL) {
1424
		/* drop reference on server */
1425
		cuse_server_unref(pcs);
1426
		return (ENOMEM);
1427
	}
1428
	if (devfs_set_cdevpriv(pcc, &cuse_client_free)) {
1419
	if (devfs_set_cdevpriv(pcc, &cuse_client_free)) {
1429
		printf("Cuse: Cannot set cdevpriv.\n");
1420
		printf("Cuse: Cannot set cdevpriv.\n");
1430
		/* drop reference on server */
1421
		/* drop reference on server */
(-)fs/ext2fs/ext2_alloc.c (-3 lines)
Lines 424-432 Link Here
424
	}
424
	}
425
425
426
	ip = malloc(sizeof(struct inode), M_EXT2NODE, M_WAITOK | M_ZERO);
426
	ip = malloc(sizeof(struct inode), M_EXT2NODE, M_WAITOK | M_ZERO);
427
	if (ip == NULL) {
428
		return (ENOMEM);
429
	}
430
427
431
	/* Allocate a new vnode/inode. */
428
	/* Allocate a new vnode/inode. */
432
	if ((error = getnewvnode("ext2fs", ump->um_mountp, &ext2_vnodeops, &vp)) != 0) {
429
	if ((error = getnewvnode("ext2fs", ump->um_mountp, &ext2_vnodeops, &vp)) != 0) {
(-)fs/ext2fs/ext2_lookup.c (-4 lines)
Lines 891-900 Link Here
891
	    EXT2F_ROCOMPAT_METADATA_CKSUM)) {
891
	    EXT2F_ROCOMPAT_METADATA_CKSUM)) {
892
		entry->e2d_reclen = dirblksize - sizeof(struct ext2fs_direct_tail);
892
		entry->e2d_reclen = dirblksize - sizeof(struct ext2fs_direct_tail);
893
		buf = malloc(dirblksize, M_TEMP, M_WAITOK);
893
		buf = malloc(dirblksize, M_TEMP, M_WAITOK);
894
		if (!buf) {
895
			error = ENOMEM;
896
			goto out;
897
		}
898
		memcpy(buf, entry, EXT2_DIR_REC_LEN(entry->e2d_namlen));
894
		memcpy(buf, entry, EXT2_DIR_REC_LEN(entry->e2d_namlen));
899
		ext2_init_dirent_tail(EXT2_DIRENT_TAIL(buf, dirblksize));
895
		ext2_init_dirent_tail(EXT2_DIRENT_TAIL(buf, dirblksize));
900
		ext2_dirent_csum_set(dp, (struct ext2fs_direct_2 *)buf);
896
		ext2_dirent_csum_set(dp, (struct ext2fs_direct_2 *)buf);
(-)fs/ext2fs/ext2_vnops.c (-10 lines)
Lines 1074-1083 Link Here
1074
			ext2_dec_nlink(dp);
1074
			ext2_dec_nlink(dp);
1075
			dp->i_flag |= IN_CHANGE;
1075
			dp->i_flag |= IN_CHANGE;
1076
			dirbuf = malloc(dp->i_e2fs->e2fs_bsize, M_TEMP, M_WAITOK | M_ZERO);
1076
			dirbuf = malloc(dp->i_e2fs->e2fs_bsize, M_TEMP, M_WAITOK | M_ZERO);
1077
			if (!dirbuf) {
1078
				error = ENOMEM;
1079
				goto bad;
1080
			}
1081
			error = vn_rdwr(UIO_READ, fvp, (caddr_t)dirbuf,
1077
			error = vn_rdwr(UIO_READ, fvp, (caddr_t)dirbuf,
1082
			    ip->i_e2fs->e2fs_bsize, (off_t)0,
1078
			    ip->i_e2fs->e2fs_bsize, (off_t)0,
1083
			    UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK,
1079
			    UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK,
Lines 1387-1398 Link Here
1387
#define DIRBLKSIZ  VTOI(dvp)->i_e2fs->e2fs_bsize
1383
#define DIRBLKSIZ  VTOI(dvp)->i_e2fs->e2fs_bsize
1388
	dirtemplate.dotdot_reclen = DIRBLKSIZ - 12;
1384
	dirtemplate.dotdot_reclen = DIRBLKSIZ - 12;
1389
	buf = malloc(DIRBLKSIZ, M_TEMP, M_WAITOK | M_ZERO);
1385
	buf = malloc(DIRBLKSIZ, M_TEMP, M_WAITOK | M_ZERO);
1390
	if (!buf) {
1391
		error = ENOMEM;
1392
		ext2_dec_nlink(dp);
1393
		dp->i_flag |= IN_CHANGE;
1394
		goto bad;
1395
	}
1396
	if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) {
1386
	if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) {
1397
		dirtemplate.dotdot_reclen -= sizeof(struct ext2fs_direct_tail);
1387
		dirtemplate.dotdot_reclen -= sizeof(struct ext2fs_direct_tail);
1398
		ext2_init_dirent_tail(EXT2_DIRENT_TAIL(buf, DIRBLKSIZ));
1388
		ext2_init_dirent_tail(EXT2_DIRENT_TAIL(buf, DIRBLKSIZ));
(-)fs/nfsclient/nfs_clstate.c (-4 / +2 lines)
Lines 3550-3559 Link Here
3550
				NFSUNLOCKCLSTATE();
3550
				NFSUNLOCKCLSTATE();
3551
			} else
3551
			} else
3552
				error = NFSERR_NOMATCHLAYOUT;
3552
				error = NFSERR_NOMATCHLAYOUT;
3553
			if (recallp != NULL) {
3553
			free(recallp, M_NFSLAYRECALL);
3554
				free(recallp, M_NFSLAYRECALL);
3554
			recallp = NULL;
3555
				recallp = NULL;
3556
			}
3557
			break;
3555
			break;
3558
		case NFSV4OP_CBSEQUENCE:
3556
		case NFSV4OP_CBSEQUENCE:
3559
			NFSM_DISSECT(tl, uint32_t *, NFSX_V4SESSIONID +
3557
			NFSM_DISSECT(tl, uint32_t *, NFSX_V4SESSIONID +
(-)mips/atheros/ar531x/apb.c (-4 lines)
Lines 627-636 Link Here
627
	struct apb_ivar	*ivar;
627
	struct apb_ivar	*ivar;
628
628
629
	ivar = malloc(sizeof(struct apb_ivar), M_DEVBUF, M_WAITOK | M_ZERO);
629
	ivar = malloc(sizeof(struct apb_ivar), M_DEVBUF, M_WAITOK | M_ZERO);
630
	if (ivar == NULL) {
631
		printf("Failed to allocate ivar\n");
632
		return (0);
633
	}
634
	resource_list_init(&ivar->resources);
630
	resource_list_init(&ivar->resources);
635
631
636
	child = device_add_child_ordered(bus, order, name, unit);
632
	child = device_add_child_ordered(bus, order, name, unit);
(-)mips/atheros/ar71xx_caldata.c (-5 lines)
Lines 86-96 Link Here
86
	    flash_addr, size);
86
	    flash_addr, size);
87
87
88
	eeprom = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO);
88
	eeprom = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO);
89
	if (! eeprom) {
90
		device_printf(dev, "%s: malloc failed for '%s', aborting EEPROM\n",
91
		__func__, buf);
92
		return;
93
	}
94
89
95
	memcpy(eeprom, cal_data, size);
90
	memcpy(eeprom, cal_data, size);
96
91
(-)mips/atheros/ar71xx_fixup.c (-6 lines)
Lines 86-97 Link Here
86
	    flash_addr, size);
86
	    flash_addr, size);
87
87
88
	eeprom = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO);
88
	eeprom = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO);
89
	if (! eeprom) {
90
		device_printf(dev,
91
			    "%s: malloc failed for '%s', aborting EEPROM\n",
92
			    __func__, buf);
93
			return;
94
	}
95
89
96
	memcpy(eeprom, cal_data, size);
90
	memcpy(eeprom, cal_data, size);
97
91
(-)net/if_vlan.c (-5 lines)
Lines 447-457 Link Here
447
		return;
447
		return;
448
448
449
	hash2 = malloc(sizeof(struct ifvlanhead) * n2, M_VLAN, M_WAITOK);
449
	hash2 = malloc(sizeof(struct ifvlanhead) * n2, M_VLAN, M_WAITOK);
450
	if (hash2 == NULL) {
451
		printf("%s: out of memory -- hash size not changed\n",
452
		    __func__);
453
		return;		/* We can live with the old hash table */
454
	}
455
	for (j = 0; j < n2; j++)
450
	for (j = 0; j < n2; j++)
456
		CK_SLIST_INIT(&hash2[j]);
451
		CK_SLIST_INIT(&hash2[j]);
457
	for (i = 0; i < n; i++)
452
	for (i = 0; i < n; i++)
(-)netinet/siftr.c (-14 / +3 lines)
Lines 400-420 Link Here
400
		/* Create a new hash node to store the flow's counter. */
400
		/* Create a new hash node to store the flow's counter. */
401
		hash_node = malloc(sizeof(struct flow_hash_node),
401
		hash_node = malloc(sizeof(struct flow_hash_node),
402
		    M_SIFTR_HASHNODE, M_WAITOK);
402
		    M_SIFTR_HASHNODE, M_WAITOK);
403
404
		if (hash_node != NULL) {
405
			/* Initialise our new hash node list entry. */
403
			/* Initialise our new hash node list entry. */
406
			hash_node->counter = 0;
404
		hash_node->counter = 0;
407
			memcpy(hash_node->key, key, sizeof(key));
405
		memcpy(hash_node->key, key, sizeof(key));
408
			LIST_INSERT_HEAD(counter_list, hash_node, nodes);
406
		LIST_INSERT_HEAD(counter_list, hash_node, nodes);
409
		} else {
410
			/* Malloc failed. */
411
			if (pkt_node->direction == DIR_IN)
412
				ss->nskip_in_malloc++;
413
			else
414
				ss->nskip_out_malloc++;
415
416
			return;
417
		}
418
	} else if (siftr_pkts_per_log > 1) {
407
	} else if (siftr_pkts_per_log > 1) {
419
		/*
408
		/*
420
		 * Taking the remainder of the counter divided
409
		 * Taking the remainder of the counter divided
(-)netpfil/ipfw/ip_dummynet.c (-8 lines)
Lines 1348-1357 Link Here
1348
		return err;
1348
		return err;
1349
	}
1349
	}
1350
	ep = malloc(l, M_DUMMYNET, M_WAITOK);
1350
	ep = malloc(l, M_DUMMYNET, M_WAITOK);
1351
	if(!ep) {
1352
		err = ENOMEM ;
1353
		return err;
1354
	}
1355
	do {
1351
	do {
1356
		err = sooptcopyin(sopt, ep, l, l);
1352
		err = sooptcopyin(sopt, ep, l, l);
1357
		if(err)
1353
		if(err)
Lines 1403-1412 Link Here
1403
		return err;
1399
		return err;
1404
	}
1400
	}
1405
	ep = malloc(l, M_DUMMYNET, M_WAITOK);
1401
	ep = malloc(l, M_DUMMYNET, M_WAITOK);
1406
	if(!ep) {
1407
		err = ENOMEM ;
1408
		return err;
1409
	}
1410
	do {
1402
	do {
1411
		err = sooptcopyin(sopt, ep, l, l);
1403
		err = sooptcopyin(sopt, ep, l, l);
1412
		if(err)
1404
		if(err)
(-)opencrypto/cryptodev.c (-4 lines)
Lines 1257-1266 Link Here
1257
	}
1257
	}
1258
1258
1259
	krp = (struct cryptkop *)malloc(sizeof *krp, M_XDATA, M_WAITOK|M_ZERO);
1259
	krp = (struct cryptkop *)malloc(sizeof *krp, M_XDATA, M_WAITOK|M_ZERO);
1260
	if (!krp) {
1261
		SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__);
1262
		return (ENOMEM);
1263
	}
1264
	krp->krp_op = kop->crk_op;
1260
	krp->krp_op = kop->crk_op;
1265
	krp->krp_status = kop->crk_status;
1261
	krp->krp_status = kop->crk_status;
1266
	krp->krp_iparams = kop->crk_iparams;
1262
	krp->krp_iparams = kop->crk_iparams;
(-)rpc/rpcsec_gss/svc_rpcsec_gss.c (-21 / +20 lines)
Lines 764-793 Link Here
764
	 * here for "{ " and "}\0".
764
	 * here for "{ " and "}\0".
765
	 */
765
	 */
766
	string_length += 4;
766
	string_length += 4;
767
	if ((bp = malloc(string_length, M_GSSAPI, M_WAITOK | M_ZERO))) {
767
	bp = malloc(string_length, M_GSSAPI, M_ZERO | M_WAITOK);
768
		strcpy(bp, "{ ");
768
	strcpy(bp, "{ ");
769
		number = (unsigned long) cp[0];
769
	number = (unsigned long) cp[0];
770
		sprintf(numstr, "%ld ", number/40);
770
	sprintf(numstr, "%ld ", number/40);
771
		strcat(bp, numstr);
771
	strcat(bp, numstr);
772
		sprintf(numstr, "%ld ", number%40);
772
	sprintf(numstr, "%ld ", number%40);
773
		strcat(bp, numstr);
773
	strcat(bp, numstr);
774
		number = 0;
774
	number = 0;
775
		cp = (unsigned char *) oid->elements;
775
	cp = (unsigned char *) oid->elements;
776
		for (i=1; i<oid->length; i++) {
776
	for (i=1; i<oid->length; i++) {
777
			number = (number << 7) | (cp[i] & 0x7f);
777
		number = (number << 7) | (cp[i] & 0x7f);
778
			if ((cp[i] & 0x80) == 0) {
778
		if ((cp[i] & 0x80) == 0) {
779
				sprintf(numstr, "%ld ", number);
779
			sprintf(numstr, "%ld ", number);
780
				strcat(bp, numstr);
780
			strcat(bp, numstr);
781
				number = 0;
781
			number = 0;
782
			}
783
		}
782
		}
784
		strcat(bp, "}");
785
		oid_str->length = strlen(bp)+1;
786
		oid_str->value = (void *) bp;
787
		*minor_status = 0;
788
		return(GSS_S_COMPLETE);
789
	}
783
	}
784
	strcat(bp, "}");
785
	oid_str->length = strlen(bp)+1;
786
	oid_str->value = (void *) bp;
790
	*minor_status = 0;
787
	*minor_status = 0;
788
	return(GSS_S_COMPLETE);
789
	*minor_status = 0;
791
	return(GSS_S_FAILURE);
790
	return(GSS_S_FAILURE);
792
}
791
}
793
#endif
792
#endif
(-)tests/framework/kern_testfrwk.c (-8 lines)
Lines 191-200 Link Here
191
	}
191
	}
192
	/* Grab some memory */
192
	/* Grab some memory */
193
	kte = malloc(sizeof(struct kern_test_entry), M_KTFRWK, M_WAITOK);
193
	kte = malloc(sizeof(struct kern_test_entry), M_KTFRWK, M_WAITOK);
194
	if (kte == NULL) {
195
		error = ENOMEM;
196
		goto out;
197
	}
198
	KTFRWK_LOCK();
194
	KTFRWK_LOCK();
199
	TAILQ_FOREACH(li, &kfrwk.kfrwk_testlist, next) {
195
	TAILQ_FOREACH(li, &kfrwk.kfrwk_testlist, next) {
200
		if (strcmp(li->name, kt.name) == 0) {
196
		if (strcmp(li->name, kt.name) == 0) {
Lines 243-252 Link Here
243
		return (E2BIG);
239
		return (E2BIG);
244
	}
240
	}
245
	te = malloc(sizeof(struct kern_test_list), M_KTFRWK, M_WAITOK);
241
	te = malloc(sizeof(struct kern_test_list), M_KTFRWK, M_WAITOK);
246
	if (te == NULL) {
247
		error = ENOMEM;
248
		goto out;
249
	}
250
	KTFRWK_LOCK();
242
	KTFRWK_LOCK();
251
	/* First does it already exist? */
243
	/* First does it already exist? */
252
	TAILQ_FOREACH(li, &kfrwk.kfrwk_testlist, next) {
244
	TAILQ_FOREACH(li, &kfrwk.kfrwk_testlist, next) {
(-)xdr/xdr_sizeof.c (-4 / +1 lines)
Lines 97-106 Link Here
97
		/* Free the earlier space and allocate new area */
97
		/* Free the earlier space and allocate new area */
98
		if (xdrs->x_private)
98
		if (xdrs->x_private)
99
			free(xdrs->x_private, M_RPC);
99
			free(xdrs->x_private, M_RPC);
100
		if ((xdrs->x_private = (caddr_t) malloc(len, M_RPC, M_WAITOK)) == NULL) {
100
		xdrs->x_private = (caddr_t) malloc(len, M_RPC, M_WAITOK);
101
			xdrs->x_base = 0;
102
			return (NULL);
103
		}
104
		xdrs->x_base = (caddr_t)(uintptr_t) len;
101
		xdrs->x_base = (caddr_t)(uintptr_t) len;
105
		xdrs->x_handy += len;
102
		xdrs->x_handy += len;
106
		return ((int32_t *) xdrs->x_private);
103
		return ((int32_t *) xdrs->x_private);

Return to bug 240545