summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/eisa/eisa_machdep.c22
-rw-r--r--sys/arch/macppc/macppc/openprom.c5
-rw-r--r--sys/arch/sparc64/sparc64/openprom.c5
-rw-r--r--sys/dev/bluetooth/bthidev.c5
-rw-r--r--sys/dev/ic/mpi.c4
-rw-r--r--sys/dev/isa/ega.c4
-rw-r--r--sys/dev/pci/drm/drm_drv.c5
-rw-r--r--sys/dev/pci/emuxki.c5
-rw-r--r--sys/dev/pci/isp_pci.c8
-rw-r--r--sys/dev/pci/mpii.c4
-rw-r--r--sys/dev/softraid_crypto.c4
-rw-r--r--sys/dev/usb/hid.c4
-rw-r--r--sys/dev/usb/if_wi_usb.c4
-rw-r--r--sys/dev/usb/umidi.c12
-rw-r--r--sys/dev/usb/uticom.c4
-rw-r--r--sys/dev/usb/uvideo.c8
-rw-r--r--sys/netinet6/nd6.c4
-rw-r--r--sys/nnpfs/nnpfs_syscalls-common.c2
-rw-r--r--sys/nnpfs/nnpfs_vfsops-common.c4
-rw-r--r--sys/nnpfs/nnpfs_vnodeops-common.c2
-rw-r--r--sys/scsi/mpath.c5
21 files changed, 55 insertions, 65 deletions
diff --git a/sys/arch/alpha/eisa/eisa_machdep.c b/sys/arch/alpha/eisa/eisa_machdep.c
index 150af807897..598d3d0eeff 100644
--- a/sys/arch/alpha/eisa/eisa_machdep.c
+++ b/sys/arch/alpha/eisa/eisa_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eisa_machdep.c,v 1.2 2008/07/25 21:11:14 miod Exp $ */
+/* $OpenBSD: eisa_machdep.c,v 1.3 2011/06/17 07:06:46 mk Exp $ */
/* $NetBSD: eisa_machdep.c,v 1.1 2000/07/29 23:18:47 thorpej Exp $ */
/*-
@@ -176,8 +176,6 @@ eisa_parse_mem(struct ecu_func *ecuf, u_int8_t *dp)
for (i = 0; i < ECUF_MEM_ENTRY_CNT; i++) {
ecum = malloc(sizeof(*ecum), M_DEVBUF, M_ZERO|M_WAITOK);
- if (ecum == NULL)
- panic("%s: can't allocate memory for ecum", __func__);
ecum->ecum_isram = dp[0] & 0x1;
ecum->ecum_unitsize = dp[1] & 0x3;
@@ -209,8 +207,6 @@ eisa_parse_irq(struct ecu_func *ecuf, u_int8_t *dp)
for (i = 0; i < ECUF_IRQ_ENTRY_CNT; i++) {
ecui = malloc(sizeof(*ecui), M_DEVBUF, M_ZERO|M_WAITOK);
- if (ecui == NULL)
- panic("%s: can't allocate memory for ecui", __func__);
ecui->ecui_irq = dp[0] & 0xf;
ecui->ecui_ist = (dp[0] & 0x20) ? IST_LEVEL : IST_EDGE;
@@ -237,8 +233,6 @@ eisa_parse_dma(struct ecu_func *ecuf, u_int8_t *dp)
for (i = 0; i < ECUF_DMA_ENTRY_CNT; i++) {
ecud = malloc(sizeof(*ecud), M_DEVBUF, M_ZERO|M_WAITOK);
- if (ecud == NULL)
- panic("%s: can't allocate memory for ecud", __func__);
ecud->ecud_drq = dp[0] & 0x7;
ecud->ecud_shared = dp[0] & 0x40;
@@ -266,8 +260,6 @@ eisa_parse_io(struct ecu_func *ecuf, u_int8_t *dp)
for (i = 0; i < ECUF_IO_ENTRY_CNT; i++) {
ecuio = malloc(sizeof(*ecuio), M_DEVBUF, M_ZERO|M_WAITOK);
- if (ecuio == NULL)
- panic("%s: can't allocate memory for ecuio", __func__);
ecuio->ecuio_addr = dp[1] | (dp[2] << 8);
ecuio->ecuio_size = (dp[0] & 0x1f) + 1;
@@ -396,9 +388,6 @@ eisa_init(eisa_chipset_tag_t ec)
i, offset, eisaid);
#endif
ecud = malloc(sizeof(*ecud), M_DEVBUF, M_ZERO|M_WAITOK);
- if (ecud == NULL)
- panic("%s: can't allocate memory for ecud",
- __func__);
SIMPLEQ_INIT(&ecud->ecud_funcs);
@@ -414,11 +403,8 @@ eisa_init(eisa_chipset_tag_t ec)
*/
cdata = malloc(CBUFSIZE, M_TEMP, M_ZERO|M_WAITOK);
- if (cdata == NULL)
- panic("%s: can't allocate memory for cdata", __func__);
+
data = malloc(CBUFSIZE, M_TEMP, M_ZERO|M_WAITOK);
- if (data == NULL)
- panic("%s: can't allocate memory for data", __func__);
SIMPLEQ_FOREACH(ecud, &ecu_data_list, ecud_list) {
cfgaddr = eisa_config_addr + ecud->ecud_offset;
@@ -532,9 +518,7 @@ eisa_init(eisa_chipset_tag_t ec)
#endif
ecuf = malloc(sizeof(*ecuf), M_DEVBUF, M_WAITOK);
- if (ecuf == NULL)
- panic("%s: can't allocate memory for ecuf",
- __func__);
+
ecuf_init(ecuf);
ecuf->ecuf_funcno = func;
SIMPLEQ_INSERT_TAIL(&ecud->ecud_funcs, ecuf,
diff --git a/sys/arch/macppc/macppc/openprom.c b/sys/arch/macppc/macppc/openprom.c
index 4214edc0ac6..01918683e85 100644
--- a/sys/arch/macppc/macppc/openprom.c
+++ b/sys/arch/macppc/macppc/openprom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openprom.c,v 1.1 2007/11/12 19:23:26 kettenis Exp $ */
+/* $OpenBSD: openprom.c,v 1.2 2011/06/17 07:06:46 mk Exp $ */
/* $NetBSD: openprom.c,v 1.4 2002/01/10 06:21:53 briggs Exp $ */
/*
@@ -202,7 +202,8 @@ openpromioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
error = ENAMETOOLONG;
break;
}
- value = nextprop = malloc(OPROMMAXPARAM, M_TEMP, M_WAITOK);
+ value = nextprop = malloc(OPROMMAXPARAM, M_TEMP,
+ M_WAITOK | M_CANFAIL);
if (nextprop == NULL) {
error = ENOMEM;
break;
diff --git a/sys/arch/sparc64/sparc64/openprom.c b/sys/arch/sparc64/sparc64/openprom.c
index bb67566e0e0..8bd95266089 100644
--- a/sys/arch/sparc64/sparc64/openprom.c
+++ b/sys/arch/sparc64/sparc64/openprom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openprom.c,v 1.16 2011/04/22 12:47:26 marco Exp $ */
+/* $OpenBSD: openprom.c,v 1.17 2011/06/17 07:06:46 mk Exp $ */
/* $NetBSD: openprom.c,v 1.4 2002/01/10 06:21:53 briggs Exp $ */
/*
@@ -254,7 +254,8 @@ openpromioctl(dev, cmd, data, flags, p)
error = ENAMETOOLONG;
break;
}
- value = nextprop = malloc(OPROMMAXPARAM, M_TEMP, M_WAITOK);
+ value = nextprop = malloc(OPROMMAXPARAM, M_TEMP,
+ M_WAITOK | M_CANFAIL);
if (nextprop == NULL) {
error = ENOMEM;
break;
diff --git a/sys/dev/bluetooth/bthidev.c b/sys/dev/bluetooth/bthidev.c
index 5ae67ea721f..11b3b277a6e 100644
--- a/sys/dev/bluetooth/bthidev.c
+++ b/sys/dev/bluetooth/bthidev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bthidev.c,v 1.8 2010/08/05 13:13:17 miod Exp $ */
+/* $OpenBSD: bthidev.c,v 1.9 2011/06/17 07:06:46 mk Exp $ */
/* $NetBSD: bthidev.c,v 1.16 2008/08/06 15:01:23 plunky Exp $ */
/*-
@@ -228,7 +228,8 @@ bthidev_attach(struct device *parent, struct device *self, void *aux)
return;
}
sc->sc_dlen = bda->bd_hid.hid_dlen;
- sc->sc_desc = malloc(bda->bd_hid.hid_dlen, M_BTHIDEV, M_WAITOK);
+ sc->sc_desc = malloc(bda->bd_hid.hid_dlen, M_BTHIDEV,
+ M_WAITOK | M_CANFAIL);
if (sc->sc_desc == NULL) {
printf(": no memory\n");
return;
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c
index b4c58493007..cc4251c2220 100644
--- a/sys/dev/ic/mpi.c
+++ b/sys/dev/ic/mpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpi.c,v 1.171 2011/04/27 06:06:30 dlg Exp $ */
+/* $OpenBSD: mpi.c,v 1.172 2011/06/17 07:06:46 mk Exp $ */
/*
* Copyright (c) 2005, 2006, 2009 David Gwynne <dlg@openbsd.org>
@@ -3409,7 +3409,7 @@ mpi_create_sensors(struct mpi_softc *sc)
return (0);
sc->sc_sensors = malloc(sizeof(struct ksensor) * vol,
- M_DEVBUF, M_WAITOK|M_ZERO);
+ M_DEVBUF, M_WAITOK|M_CANFAIL|M_ZERO);
if (sc->sc_sensors == NULL)
return (1);
diff --git a/sys/dev/isa/ega.c b/sys/dev/isa/ega.c
index 4338661533a..061a7c36799 100644
--- a/sys/dev/isa/ega.c
+++ b/sys/dev/isa/ega.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ega.c,v 1.15 2009/09/05 14:09:35 miod Exp $ */
+/* $OpenBSD: ega.c,v 1.16 2011/06/17 07:06:47 mk Exp $ */
/* $NetBSD: ega.c,v 1.4.4.1 2000/06/30 16:27:47 simonb Exp $ */
/*
@@ -842,7 +842,7 @@ ega_load_font(v, cookie, data)
if (vc->vc_fonts[slot] != NULL)
return (EEXIST);
- f = malloc(sizeof(struct egafont), M_DEVBUF, M_WAITOK);
+ f = malloc(sizeof(struct egafont), M_DEVBUF, M_WAITOK | M_CANFAIL);
if (f == NULL)
return (ENOMEM);
strlcpy(f->name, data->name, sizeof(f->name));
diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c
index 9eb142ff6b1..18338918e48 100644
--- a/sys/dev/pci/drm/drm_drv.c
+++ b/sys/dev/pci/drm/drm_drv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_drv.c,v 1.93 2011/06/02 18:22:00 weerd Exp $ */
+/* $OpenBSD: drm_drv.c,v 1.94 2011/06/17 07:06:47 mk Exp $ */
/*-
* Copyright 2007-2009 Owain G. Ainsworth <oga@openbsd.org>
* Copyright © 2008 Intel Corporation
@@ -1566,7 +1566,8 @@ drm_gem_load_uao(bus_dma_tag_t dmat, bus_dmamap_t map, struct uvm_object *uao,
* This is really quite ugly, but nothing else would need
* bus_dmamap_load_uao() yet.
*/
- segs = malloc(npages * sizeof(*segs), M_DRM, M_WAITOK | M_ZERO);
+ segs = malloc(npages * sizeof(*segs), M_DRM,
+ M_WAITOK | M_CANFAIL | M_ZERO);
if (segs == NULL)
return (ENOMEM);
diff --git a/sys/dev/pci/emuxki.c b/sys/dev/pci/emuxki.c
index 24dcfbe3b2a..e8691e46f51 100644
--- a/sys/dev/pci/emuxki.c
+++ b/sys/dev/pci/emuxki.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: emuxki.c,v 1.38 2011/04/03 15:36:02 jasper Exp $ */
+/* $OpenBSD: emuxki.c,v 1.39 2011/06/17 07:06:47 mk Exp $ */
/* $NetBSD: emuxki.c,v 1.1 2001/10/17 18:39:41 jdolecek Exp $ */
/*-
@@ -1187,7 +1187,8 @@ emuxki_channel_new(struct emuxki_voice *voice, u_int8_t num)
{
struct emuxki_channel *chan;
- chan = malloc(sizeof(struct emuxki_channel), M_DEVBUF, M_WAITOK);
+ chan = malloc(sizeof(struct emuxki_channel), M_DEVBUF,
+ M_WAITOK | M_CANFAIL);
if (chan == NULL)
return (NULL);
diff --git a/sys/dev/pci/isp_pci.c b/sys/dev/pci/isp_pci.c
index 52e7401ad35..9de50ae9959 100644
--- a/sys/dev/pci/isp_pci.c
+++ b/sys/dev/pci/isp_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isp_pci.c,v 1.55 2011/04/22 23:19:54 deraadt Exp $ */
+/* $OpenBSD: isp_pci.c,v 1.56 2011/06/17 07:06:47 mk Exp $ */
/* $FreeBSD: src/sys/dev/isp/isp_pci.c,v 1.148 2007/06/26 23:08:57 mjacob Exp $*/
/*-
* Copyright (c) 1997-2006 by Matthew Jacob
@@ -1275,13 +1275,15 @@ isp_pci_mbxdma(struct ispsoftc *isp)
return (0);
len = isp->isp_maxcmds * sizeof (XS_T *);
- isp->isp_xflist = malloc(len, M_DEVBUF, M_WAITOK | M_ZERO);
+ isp->isp_xflist = malloc(len, M_DEVBUF,
+ M_WAITOK | M_CANFAIL | M_ZERO);
if (isp->isp_xflist == NULL) {
isp_prt(isp, ISP_LOGERR, "cannot malloc xflist array");
return (1);
}
len = isp->isp_maxcmds * sizeof (bus_dmamap_t);
- pcs->pci_xfer_dmap = (bus_dmamap_t *) malloc(len, M_DEVBUF, M_WAITOK);
+ pcs->pci_xfer_dmap = (bus_dmamap_t *) malloc(len, M_DEVBUF,
+ M_WAITOK | M_CANFAIL);
if (pcs->pci_xfer_dmap == NULL) {
free(isp->isp_xflist, M_DEVBUF);
isp->isp_xflist = NULL;
diff --git a/sys/dev/pci/mpii.c b/sys/dev/pci/mpii.c
index 1cab14d016b..d1be9cbe1f1 100644
--- a/sys/dev/pci/mpii.c
+++ b/sys/dev/pci/mpii.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpii.c,v 1.42 2011/05/25 00:12:46 dlg Exp $ */
+/* $OpenBSD: mpii.c,v 1.43 2011/06/17 07:06:47 mk Exp $ */
/*
* Copyright (c) 2010 Mike Belopuhov <mkb@crypt.org.ru>
* Copyright (c) 2009 James Giannoules
@@ -5285,7 +5285,7 @@ mpii_create_sensors(struct mpii_softc *sc)
int i;
sc->sc_sensors = malloc(sizeof(struct ksensor) * sc->sc_vd_count,
- M_DEVBUF, M_WAITOK | M_ZERO);
+ M_DEVBUF, M_WAITOK | M_CANFAIL | M_ZERO);
if (sc->sc_sensors == NULL)
return (1);
sc->sc_nsensors = sc->sc_vd_count;
diff --git a/sys/dev/softraid_crypto.c b/sys/dev/softraid_crypto.c
index fd359681f7a..3dd097abffc 100644
--- a/sys/dev/softraid_crypto.c
+++ b/sys/dev/softraid_crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_crypto.c,v 1.67 2011/06/05 11:09:00 stsp Exp $ */
+/* $OpenBSD: softraid_crypto.c,v 1.68 2011/06/17 07:06:46 mk Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Hans-Joerg Hoexer <hshoexer@openbsd.org>
@@ -590,7 +590,7 @@ sr_crypto_change_maskkey(struct sr_discipline *sd,
c = (u_char *)sd->mds.mdd_crypto.scr_meta->scm_key;
ksz = sizeof(sd->mds.mdd_crypto.scr_key);
- p = malloc(ksz, M_DEVBUF, M_WAITOK | M_ZERO);
+ p = malloc(ksz, M_DEVBUF, M_WAITOK | M_CANFAIL | M_ZERO);
if (p == NULL)
goto out;
diff --git a/sys/dev/usb/hid.c b/sys/dev/usb/hid.c
index 3e9df98fe29..7cfb771b3ca 100644
--- a/sys/dev/usb/hid.c
+++ b/sys/dev/usb/hid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hid.c,v 1.23 2011/04/05 15:03:02 miod Exp $ */
+/* $OpenBSD: hid.c,v 1.24 2011/06/17 07:06:47 mk Exp $ */
/* $NetBSD: hid.c,v 1.23 2002/07/11 21:14:25 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */
@@ -89,8 +89,6 @@ hid_start_parse(void *d, int len, enum hid_kind kind)
struct hid_data *s;
s = malloc(sizeof *s, M_TEMP, M_WAITOK | M_ZERO);
- if (s == NULL)
- panic("hid_start_parse");
s->start = s->p = d;
s->end = (char *)d + len;
diff --git a/sys/dev/usb/if_wi_usb.c b/sys/dev/usb/if_wi_usb.c
index df32a86c047..5494a9c071d 100644
--- a/sys/dev/usb/if_wi_usb.c
+++ b/sys/dev/usb/if_wi_usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_usb.c,v 1.50 2011/01/25 20:03:35 jakemsr Exp $ */
+/* $OpenBSD: if_wi_usb.c,v 1.51 2011/06/17 07:06:47 mk Exp $ */
/*
* Copyright (c) 2003 Dale Rahn. All rights reserved.
@@ -963,7 +963,7 @@ wi_alloc_nicmem_usb(struct wi_softc *wsc, int len, int *id)
return ENOMEM;
}
- sc->wi_usb_txmem[nmem] = malloc(len, M_DEVBUF, M_WAITOK);
+ sc->wi_usb_txmem[nmem] = malloc(len, M_DEVBUF, M_WAITOK | M_CANFAIL);
if (sc->wi_usb_txmem[nmem] == NULL) {
sc->wi_usb_nummem--;
return ENOMEM;
diff --git a/sys/dev/usb/umidi.c b/sys/dev/usb/umidi.c
index 78ae450a612..82fb2e1c50a 100644
--- a/sys/dev/usb/umidi.c
+++ b/sys/dev/usb/umidi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umidi.c,v 1.28 2011/01/25 20:03:36 jakemsr Exp $ */
+/* $OpenBSD: umidi.c,v 1.29 2011/06/17 07:06:47 mk Exp $ */
/* $NetBSD: umidi.c,v 1.16 2002/07/11 21:14:32 augustss Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -456,7 +456,7 @@ alloc_all_endpoints_fixed_ep(struct umidi_softc *sc)
sc->sc_endpoints = malloc(sizeof(*sc->sc_out_ep)*
(sc->sc_out_num_endpoints+
sc->sc_in_num_endpoints),
- M_USBDEV, M_WAITOK);
+ M_USBDEV, M_WAITOK | M_CANFAIL);
if (!sc->sc_endpoints) {
return USBD_NOMEM;
}
@@ -599,7 +599,7 @@ alloc_all_endpoints_yamaha(struct umidi_softc *sc)
sc->sc_endpoints = malloc(sizeof(struct umidi_endpoint)*
(sc->sc_out_num_endpoints+
sc->sc_in_num_endpoints),
- M_USBDEV, M_WAITOK);
+ M_USBDEV, M_WAITOK | M_CANFAIL);
if (!sc->sc_endpoints)
return USBD_NOMEM;
if (sc->sc_out_num_endpoints) {
@@ -641,7 +641,7 @@ alloc_all_endpoints_genuine(struct umidi_softc *sc)
interface_desc = usbd_get_interface_descriptor(sc->sc_iface);
num_ep = interface_desc->bNumEndpoints;
sc->sc_endpoints = p = malloc(sizeof(struct umidi_endpoint) * num_ep,
- M_USBDEV, M_WAITOK);
+ M_USBDEV, M_WAITOK | M_CANFAIL);
if (!p)
return USBD_NOMEM;
@@ -734,7 +734,7 @@ alloc_all_jacks(struct umidi_softc *sc)
sc->sc_jacks =
malloc(sizeof(*sc->sc_out_jacks)*(sc->sc_in_num_jacks+
sc->sc_out_num_jacks),
- M_USBDEV, M_WAITOK);
+ M_USBDEV, M_WAITOK | M_CANFAIL);
if (!sc->sc_jacks)
return USBD_NOMEM;
sc->sc_out_jacks =
@@ -975,7 +975,7 @@ alloc_all_mididevs(struct umidi_softc *sc, int nmidi)
{
sc->sc_num_mididevs = nmidi;
sc->sc_mididevs = malloc(sizeof(*sc->sc_mididevs)*nmidi, M_USBDEV,
- M_WAITOK | M_ZERO);
+ M_WAITOK | M_CANFAIL | M_ZERO);
if (!sc->sc_mididevs)
return USBD_NOMEM;
diff --git a/sys/dev/usb/uticom.c b/sys/dev/usb/uticom.c
index d3c3d058366..7bfe546e719 100644
--- a/sys/dev/usb/uticom.c
+++ b/sys/dev/usb/uticom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uticom.c,v 1.14 2011/04/05 20:42:43 jsg Exp $ */
+/* $OpenBSD: uticom.c,v 1.15 2011/06/17 07:06:47 mk Exp $ */
/*
* Copyright (c) 2005 Dmitry Komissaroff <dxi@mail.ru>.
*
@@ -925,7 +925,7 @@ uticom_download_fw(struct uticom_softc *sc, int pipeno,
return (error);
buffer_size = UTICOM_FW_BUFSZ + sizeof(struct uticom_fw_header);
- buffer = malloc(buffer_size, M_USBDEV, M_WAITOK);
+ buffer = malloc(buffer_size, M_USBDEV, M_WAITOK | M_CANFAIL);
if (!buffer) {
printf("%s: uticom_download_fw: out of memory\n",
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index 2e9712de891..3cbe0c76a84 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.c,v 1.161 2011/04/11 02:04:48 jakemsr Exp $ */
+/* $OpenBSD: uvideo.c,v 1.162 2011/06/17 07:06:47 mk Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
@@ -3242,7 +3242,7 @@ uvideo_queryctrl(void *v, struct v4l2_queryctrl *qctrl)
return (EINVAL);
}
- ctrl_data = malloc(ctrl_len, M_USBDEV, M_WAITOK);
+ ctrl_data = malloc(ctrl_len, M_USBDEV, M_WAITOK | M_CANFAIL);
if (ctrl_data == NULL) {
printf("%s: could not allocate control data\n", __func__);
return (ENOMEM);
@@ -3357,7 +3357,7 @@ uvideo_g_ctrl(void *v, struct v4l2_control *gctrl)
return (EINVAL);
}
- ctrl_data = malloc(ctrl_len, M_USBDEV, M_WAITOK);
+ ctrl_data = malloc(ctrl_len, M_USBDEV, M_WAITOK | M_CANFAIL);
if (ctrl_data == NULL) {
printf("%s: could not allocate control data\n", __func__);
return (ENOMEM);
@@ -3405,7 +3405,7 @@ uvideo_s_ctrl(void *v, struct v4l2_control *sctrl)
return (EINVAL);
}
- ctrl_data = malloc(ctrl_len, M_USBDEV, M_WAITOK);
+ ctrl_data = malloc(ctrl_len, M_USBDEV, M_WAITOK | M_CANFAIL);
if (ctrl_data == NULL) {
printf("%s: could not allocate control data\n", __func__);
return (ENOMEM);
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 4135ca28847..0207bfbf964 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.c,v 1.86 2011/03/09 23:31:24 bluhm Exp $ */
+/* $OpenBSD: nd6.c,v 1.87 2011/06/17 07:06:47 mk Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
@@ -2040,7 +2040,7 @@ nd6_sysctl(int name, void *oldp, size_t *oldlenp, void *newp, size_t newlen)
ol = oldlenp ? *oldlenp : 0;
if (oldp) {
- p = malloc(*oldlenp, M_TEMP, M_WAITOK);
+ p = malloc(*oldlenp, M_TEMP, M_WAITOK | M_CANFAIL);
if (!p)
return ENOMEM;
} else
diff --git a/sys/nnpfs/nnpfs_syscalls-common.c b/sys/nnpfs/nnpfs_syscalls-common.c
index cfe06490fe4..fb119c64013 100644
--- a/sys/nnpfs/nnpfs_syscalls-common.c
+++ b/sys/nnpfs/nnpfs_syscalls-common.c
@@ -496,7 +496,7 @@ remote_pioctl (d_thread_t *p,
struct nnpfs_message_pioctl *msg = NULL;
struct nnpfs_message_wakeup_data *msg2;
- msg = malloc(sizeof(*msg), M_TEMP, M_WAITOK | M_ZERO);
+ msg = malloc(sizeof(*msg), M_TEMP, M_WAITOK | M_CANFAIL | M_ZERO);
if (msg == NULL) {
error = ENOMEM;
goto done;
diff --git a/sys/nnpfs/nnpfs_vfsops-common.c b/sys/nnpfs/nnpfs_vfsops-common.c
index a3a992453bd..563f1667b0d 100644
--- a/sys/nnpfs/nnpfs_vfsops-common.c
+++ b/sys/nnpfs/nnpfs_vfsops-common.c
@@ -199,12 +199,12 @@ nnpfs_mount_common(struct mount *mp,
size_t count;
int error = 0;
- data = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
+ data = malloc(MAXPATHLEN, M_TEMP, M_WAITOK | M_CANFAIL);
if (data == NULL) {
error = ENOMEM;
goto done;
}
- path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
+ path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK | M_CANFAIL);
if (path == NULL) {
error = ENOMEM;
goto done;
diff --git a/sys/nnpfs/nnpfs_vnodeops-common.c b/sys/nnpfs/nnpfs_vnodeops-common.c
index fa01d81932a..c46539d18d2 100644
--- a/sys/nnpfs/nnpfs_vnodeops-common.c
+++ b/sys/nnpfs/nnpfs_vnodeops-common.c
@@ -931,7 +931,7 @@ nnpfs_symlink_common(struct vnode *dvp,
NNPFSDEB(XDEBVNOPS, ("nnpfs_symlink: %s\n", name));
- msg = malloc(sizeof(*msg), M_TEMP, M_WAITOK | M_ZERO);
+ msg = malloc(sizeof(*msg), M_TEMP, M_WAITOK | M_CANFAIL | M_ZERO);
if (msg == NULL) {
error = ENOMEM;
goto done;
diff --git a/sys/scsi/mpath.c b/sys/scsi/mpath.c
index f48df0bd1e7..1a938c41c56 100644
--- a/sys/scsi/mpath.c
+++ b/sys/scsi/mpath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpath.c,v 1.21 2011/04/27 05:22:24 dlg Exp $ */
+/* $OpenBSD: mpath.c,v 1.22 2011/06/17 07:06:47 mk Exp $ */
/*
* Copyright (c) 2009 David Gwynne <dlg@openbsd.org>
@@ -395,7 +395,8 @@ mpath_path_attach(struct mpath_path *p)
if (target >= MPATH_BUSWIDTH)
return (ENXIO);
- d = malloc(sizeof(*d), M_DEVBUF, M_WAITOK | M_ZERO);
+ d = malloc(sizeof(*d), M_DEVBUF,
+ M_WAITOK | M_CANFAIL | M_ZERO);
if (d == NULL)
return (ENOMEM);