1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

sound: Stop checking for failures from malloc(M_WAITOK)

Reviewed by:	emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit 59121599bb)
(cherry picked from commit bfcaaff418)
This commit is contained in:
Zhenlei Huang 2024-09-03 18:25:33 +08:00
parent 68c96d15d3
commit 36fb983d22
2 changed files with 21 additions and 29 deletions

View File

@ -242,10 +242,8 @@ i2s_attach(device_t self)
* Register a hook for delayed attach in order to allow * Register a hook for delayed attach in order to allow
* the I2C controller to attach. * the I2C controller to attach.
*/ */
if ((i2s_delayed_attach = malloc(sizeof(struct intr_config_hook), i2s_delayed_attach = malloc(sizeof(struct intr_config_hook),
M_TEMP, M_WAITOK | M_ZERO)) == NULL) M_TEMP, M_WAITOK | M_ZERO);
return (ENOMEM);
i2s_delayed_attach->ich_func = i2s_postattach; i2s_delayed_attach->ich_func = i2s_postattach;
i2s_delayed_attach->ich_arg = sc; i2s_delayed_attach->ich_arg = sc;

View File

@ -2634,8 +2634,6 @@ uaudio_chan_init(struct uaudio_chan *ch, struct snd_dbuf *b,
DPRINTF("Worst case buffer is %d bytes\n", (int)buf_size); DPRINTF("Worst case buffer is %d bytes\n", (int)buf_size);
ch->buf = malloc(buf_size, M_DEVBUF, M_WAITOK | M_ZERO); 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) if (sndbuf_setup(b, ch->buf, buf_size) != 0)
goto error; goto error;
@ -3204,7 +3202,6 @@ uaudio_mixer_add_ctl_sub(struct uaudio_softc *sc, struct uaudio_mixer_node *mc)
malloc(sizeof(*p_mc_new), M_USBDEV, M_WAITOK); malloc(sizeof(*p_mc_new), M_USBDEV, M_WAITOK);
int ch; int ch;
if (p_mc_new != NULL) {
memcpy(p_mc_new, mc, sizeof(*p_mc_new)); memcpy(p_mc_new, mc, sizeof(*p_mc_new));
p_mc_new->next = sc->sc_mixer_root; p_mc_new->next = sc->sc_mixer_root;
sc->sc_mixer_root = p_mc_new; sc->sc_mixer_root = p_mc_new;
@ -3227,9 +3224,6 @@ uaudio_mixer_add_ctl_sub(struct uaudio_softc *sc, struct uaudio_mixer_node *mc)
break; break;
} }
} }
} else {
DPRINTF("out of memory\n");
}
} }
static void static void