From nobody Sun Oct 20 11:21:46 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 4XWbcV6rB0z5Yvr7; Sun, 20 Oct 2024 11:21:46 +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 4XWbcV4Zy6z4XMd; Sun, 20 Oct 2024 11:21:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729423306; 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=01kvSu5YNmNvnLDRUKtm8x7icfH32Kf8QSxMj2vaPdE=; b=fiWCRAzWwtrJ7bk7/n3+IQdUp6FcvtUkuxmJxEMpzdx1oUGYO15/H72j1kgPYXg3W7j6Qn nQCwHn0z77yaBr4AeD4NWoeMyMo+1wWtcfTUQBXk/e3StN+RBe/2a0EeSpwA2SUke3DQ5E Iisr1w5kjap/bbJzXOUKYZjBW8nJgbWuZ4tSGHfnioOETpsbkxwwbGt6q0FkfL2WKnH5c+ 8zA4jw/s+I9bSnyOJ4LnF92q0GaHqRTyfYJ5AdnktMzXsvtKpNPSXihHjnc9Ehq7JNDqVj HI3D4z0x6AvBeiUb9bLPJInDay6Y5AYmrlJcPj7pFHrDrH0PREdkU2PL+/d5Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729423306; 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=01kvSu5YNmNvnLDRUKtm8x7icfH32Kf8QSxMj2vaPdE=; b=B9EC4iLw1DOnA8cqDr1wzx0+rmZKbWIKLByu7+YrmQNddp3iempfo00cltA8VS4efLNSJU 3P/bDMp7HUbKVV1iijQ0sNYq6a9u6+ryYVxHt8+nRJ8XL1oczjCNs5NoII6jMmDcoKf7ag tZ6sY6Gua4hO+vy5htm1310KJbi4q/G8XtWv3im83nekIM3NLhh2P54j9ItC52AzdyJKd+ M8dd1GGswvUltHSisJGMjTaHibBJAhwvyGxBOFeFSUlm59Ie97EE29xZGcDtBDg1pj55q+ RQA0DovVQWdRWzC6nOUTinRQZ0jmUd4UIPHFd4yMBzMlRC5q1681PfNwvkXzMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729423306; a=rsa-sha256; cv=none; b=IUeUJiZz8jN9B3KFIn19UhjODjjX9S6QR8oqTtiznRBK2U/i46kv94fL0wTDytbvKRHFou ljpc2sFSI7Xnw6IG1v0GRCsvSvCEHTOfdC/hngsWYpRMP/CaEly3TdtgLxgP0/ZK20ycsZ oI8rfh7bW9bh+DmO6WWtagitQhoCnnFg5wv8ODo8MMKBRtPtOw1g6tviT+CkRq3c5h0GxD jLZn1d0BFeIUrI1pOz47ZJ5+YFaEMAKVTLeebSXwxAXGRV0UD7QdNsuSaLoOc56lnaSzcs qGUIt8HZwtYGOGkc4/D6o5odibNB/ob0vvyzULMEN+OCCqDhleIfkkWaGmT+UA== 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 4XWbcV4B5Mz10F5; Sun, 20 Oct 2024 11:21:46 +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 49KBLkQ8063241; Sun, 20 Oct 2024 11:21:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49KBLkOB063238; Sun, 20 Oct 2024 11:21:46 GMT (envelope-from git) Date: Sun, 20 Oct 2024 11:21:46 GMT Message-Id: <202410201121.49KBLkOB063238@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 7a7ba76aa6f0 - stable/14 - sound: Do not check for NULL if sbuf is allocated with SBUF_AUTOEXTEND 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: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7a7ba76aa6f0af34fd60b3d13d93ef28598f7e23 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=7a7ba76aa6f0af34fd60b3d13d93ef28598f7e23 commit 7a7ba76aa6f0af34fd60b3d13d93ef28598f7e23 Author: Christos Margiolis AuthorDate: 2024-10-18 08:41:16 +0000 Commit: Christos Margiolis CommitDate: 2024-10-20 11:21:06 +0000 sound: Do not check for NULL if sbuf is allocated with SBUF_AUTOEXTEND Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D46846 (cherry picked from commit aaf84d0e96831cd886b8e1e4ae102b3ba703b90a) --- sys/dev/sound/midi/midi.c | 6 +----- sys/dev/sound/pcm/sndstat.c | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c index d2b495ea04cd..cae030519285 100644 --- a/sys/dev/sound/midi/midi.c +++ b/sys/dev/sound/midi/midi.c @@ -951,12 +951,8 @@ midistat_open(struct cdev *i_dev, int flags, int mode, struct thread *td) return EBUSY; } midistat_isopen = 1; - if (sbuf_new(&midistat_sbuf, NULL, 4096, SBUF_AUTOEXTEND) == NULL) { - error = ENXIO; - goto out; - } + sbuf_new(&midistat_sbuf, NULL, 4096, SBUF_AUTOEXTEND); error = (midistat_prepare(&midistat_sbuf) > 0) ? 0 : ENOMEM; -out: if (error) midistat_isopen = 0; midistat_unlock(); diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index 993ca926070f..bc51da083439 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -150,10 +150,7 @@ sndstat_open(struct cdev *i_dev, int flags, int mode, struct thread *td) pf = malloc(sizeof(*pf), M_DEVBUF, M_WAITOK | M_ZERO); - if (sbuf_new(&pf->sbuf, NULL, 4096, SBUF_AUTOEXTEND) == NULL) { - free(pf, M_DEVBUF); - return (ENOMEM); - } + sbuf_new(&pf->sbuf, NULL, 4096, SBUF_AUTOEXTEND); pf->fflags = flags; TAILQ_INIT(&pf->userdev_list);