From nobody Tue Sep 03 10:27:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WyhdZ3ZRnz5MkS8; Tue, 03 Sep 2024 10:27:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WyhdZ0kD0z4tBb; Tue, 3 Sep 2024 10:27:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Xm4RfxI5hLSYKNG0lf7KGeHKEAJ1YveqBKR0CJQZ9U=; b=EGUdFvkyoGBr6vXiX4q6nE5nZBR30RX3eK6EZTkrvM92QxXWpnv1bRwHAuD4XW1sf3G8DQ fLxUAI7UESyelHQ95A8If3bE1iAqc2MKjwNxY1VQrdzWZGlGJXgQmmP3jnVQWAUUVy0G5O ez+wIvUXXuYHEEyQuQARmeBzi2jTBbY1C+ifv5JaNK1IJ3A5qZVh0i42MDrKG4nApTXOYq FRInVcl9JlGIbDVmKumpe4bzrPpOeMtt/lwsLGEo8EhPP6asJ8PfSlOGuLkmC4OZXF2goT Spafy3RNcHJiSEe85+5wQdZSYjXQEtH/MtuMtvvgkWdk2X03OX4bqgKyJZ6A3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359250; a=rsa-sha256; cv=none; b=J/pOUm4MGjLp/L1HuCrHkm31bMPI2hZvDtqM/WzFgsJd1DYhuPIjYiS8W2/wQRkkM+o0bM JYnHvByS2j6bAmkpyFbbIbOj6tK4oMigQJY2kWZq7kHmWpOdqlwWhSd14siVlMXgl8Fibp sv5l7RIgBjip3OH36xrjzQNJi+HRyy3ghHXg588Nn/AKEqsXbgNySOrk+5o8UoxPIz8NIC baAKDIQ7R80VOgZNXnAsd7suRMwafRWxHEtA/OG0/eWJvWoqrZ4tAGEKDaxRfK3e62nKrC 5WNmc3R/bkdd0yFGks7F5C1iVkm0IZBw6ZZQBaJM0ZZvZ1qzanEamT4jqMSH/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Xm4RfxI5hLSYKNG0lf7KGeHKEAJ1YveqBKR0CJQZ9U=; b=LVcfyur/gCfC3ldPKvdoxYQj4iGJ4IKhFa1Hfo5KU8LEtwxajLNSe6sFwqMx7vkVT3Sv8N ZvQo9WWuUeWgPeY5Pl5w+jAj44t9zSpgCZUm0TGzbdOO2XfaNFa3yNmsr1fJvFKNkqaG+4 TYtX+WpTxNICYfNS3slxDSEO6uB4sDRjNXtz0jk0Gj+P1RSRvwDVdjngYI2XP816yv1UXC tqkF58q3xAozZM6SWoquVMhij2I2P6Vt5yBIaxIm20sAZx4zU+gzKUJM73NNwf/1t1zY1e /lwod7UxNt8wPDKDOxyz7VLcWWKHUpqX0mZUU5hn6CGnXjGTY8pYATAoydt/mQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WyhdZ03hvzcLJ; Tue, 3 Sep 2024 10:27:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 483ART79010812; Tue, 3 Sep 2024 10:27:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ARToa010809; Tue, 3 Sep 2024 10:27:29 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:27:29 GMT Message-Id: <202409031027.483ARToa010809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 59121599bbda - main - sound: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59121599bbda1e4c3fc3c6e887cd48cd5e3afc70 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=59121599bbda1e4c3fc3c6e887cd48cd5e3afc70 commit 59121599bbda1e4c3fc3c6e887cd48cd5e3afc70 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:33 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:33 +0000 sound: Stop checking for failures from malloc(M_WAITOK) Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- sys/dev/sound/macio/i2s.c | 6 ++---- sys/dev/sound/usb/uaudio.c | 44 +++++++++++++++++++------------------------- 2 files changed, 21 insertions(+), 29 deletions(-) diff --git a/sys/dev/sound/macio/i2s.c b/sys/dev/sound/macio/i2s.c index 5f8cb3aa15f7..647d66c27bba 100644 --- a/sys/dev/sound/macio/i2s.c +++ b/sys/dev/sound/macio/i2s.c @@ -241,10 +241,8 @@ i2s_attach(device_t self) * 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 index 166af8a0857d..0a8878c072d2 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -2687,8 +2687,6 @@ uaudio_chan_init(struct uaudio_chan *ch, struct snd_dbuf *b, 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; @@ -3256,31 +3254,27 @@ uaudio_mixer_add_ctl_sub(struct uaudio_softc *sc, struct uaudio_mixer_node *mc) 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"); } }