From nobody Mon Sep 30 05:08:36 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 4XH8H91MVRz5Xlmd; Mon, 30 Sep 2024 05:08:37 +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 4XH8H85FtSz4XSB; Mon, 30 Sep 2024 05:08:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727672916; 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=S6wBe0nC+fkEIx+Ms33Snzcf0EPcW8L6ioVHqA+Fhsw=; b=fvAmRvXiTD6lWvq1+/rOFhahNQjPnBQWYVtFR37bQjyCbyBGHZ8gt8QF3lkawgjahnFuRO 15NM3OtmXyiMw7OxkrZ2A13eDTpdL2GcnHqt/SvT1r4QJ/K80QKhd3FMi4iwTXHW2HP3Ue NDzYCg9hAOECjObKa8rgAzCaArb82ZRNmJX7Wy6a/rbTOIkMy/+oIGXd5JfiHDKLsd6dKX zqs0iF27yj7xnXQJbw3XjMk+q6OFpPRlwpyKB8wmbhueWYg15vIEnQh7eEWfRnxhmvfNcP FqjZVNS7mPm3Pp3TgfZhrX2o1eRjXgTQe75BIxW66on7uezGLRnVd89Rpx0I8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727672916; 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=S6wBe0nC+fkEIx+Ms33Snzcf0EPcW8L6ioVHqA+Fhsw=; b=sE5Q2lQt4pRhR21i5RcsLFcqzC/nypQI0x9qWHJIUbkk5XO6dwRqfqf99Ek8v5zsnnYieN nWeBNnRqcjcO3YY0nHBd+pSOZuhEEXoRImAnsc45Y2mEUzlPJ6HiBYCYNDLNbCaohVwI5j 6gWez1tlP91ZVOEpW+AF0bOiRA9rX83EnW7iAXC6WrBdHaTiqOGTora0ffB9WaKoEAe+NZ cyppeaen2eYjTDKicHahrEdMhBDNKW2436O4Jj71hh9W+FMfB2ABrSm9eS+NwnMAha4ZKC cvwy7mwXdn3+u1Ua4D5p5iX96VQvL1dlZqsV40uhbuIDtsXJF4cNG9O8H2Focg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727672916; a=rsa-sha256; cv=none; b=TCBexQrEe9eSPh4HSb9vvDV5TExWcWjfqvprNxeHadO4fJRtxfo3++3/LfH8RjhoqQefGF fF75+Ibol4mCPBJBQOYSTD46Te9crLleyY2F2H33JuvXQt4t7NJm+Rdy7WVTQiZpTm502Q lRRs6jtnGXY+gTC6ZwTGCIftfILpGK5rXNe4TVEkNkMY3NZazNKKjiH4Ou7uXsEmuJTEsv MuStajJPc9+YPvg8gYiiJS4jakkwVIdWLjizYeMy1a4KnWFCSI69drFqRfRu25BUQkfeJS TW9K33gri5+8Q5lyVXFgjQ+BxFE3TFCckQ3wevbMJBRzeMLOQn5vecDUn9rrNg== 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 4XH8H84sTvzftf; Mon, 30 Sep 2024 05:08:36 +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 48U58a8j025616; Mon, 30 Sep 2024 05:08:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48U58aUu025613; Mon, 30 Sep 2024 05:08:36 GMT (envelope-from git) Date: Mon, 30 Sep 2024 05:08:36 GMT Message-Id: <202409300508.48U58aUu025613@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 36fb983d227d - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 36fb983d227decf10b26b666000fa69e832eb641 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=36fb983d227decf10b26b666000fa69e832eb641 commit 36fb983d227decf10b26b666000fa69e832eb641 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:33 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-30 05:05:39 +0000 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 59121599bbda1e4c3fc3c6e887cd48cd5e3afc70) (cherry picked from commit bfcaaff418b856ef3d2a5be665566f62824f2f09) --- 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 a769b9d81652..814bdd7e6bdc 100644 --- a/sys/dev/sound/macio/i2s.c +++ b/sys/dev/sound/macio/i2s.c @@ -242,10 +242,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 df6df8fd8e96..b2fd6096f323 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -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); 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; @@ -3204,31 +3202,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"); } }