From nobody Fri Oct 18 08:45:07 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 4XVJDg6G3zz5YwPq; Fri, 18 Oct 2024 08:45:07 +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 4XVJDg457Cz4mVt; Fri, 18 Oct 2024 08:45:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729241107; 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=oxzYZui7/1HIAcOjbA4ctyTdTQjj+ZItMBH3Dw9/wjo=; b=VNyqgm+7Zgkpb0kiMQZyugBPaWoGBOHhbtobgqJdgIlxS9ouxeTiiQfhrbuxnBV+Id2K5o +1UBuYv7S7fOwoDE7UfTocEVrCEgmjTGUmmVZjSxZVJ3oCz/77Zcc+5KA6SfObOMOJMBxt 7B0TK4UpkQZiQfAt766q/s7Ef9qOx3xni58+dT/rZF53YBW68x0HVTNgCHSyiIX3u0esxq QNfWB26mZSa3IU0kzsnXIhAol3yYqQnmoVO02psPBBlUmwFuxhXKci4awf2YPclnPHihIP syATe4gKYaLbPROx204Q9i1VGZMGxP6aXHaMdvS7taZ2+5iymgSRt1thDS2scg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729241107; 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=oxzYZui7/1HIAcOjbA4ctyTdTQjj+ZItMBH3Dw9/wjo=; b=QLWQtS0Ykjw7yCoX3P/YKLCFw+3RLK8IdB4HC3PvuqA1tS5d5Vtpkg8VQxX5VYMGCZa6Nq 9afjJkIMYCu1JxvFjQnUA4l6/EQAIxlR0MBEA3yI7CoqDQO1zGuI5dfE+TVCphHZ0ZL5rI BGh0MxrRfdTp8G9Wsfr8/7RYRoVbLDm9CxdBKlYqPPrUOwuPqZuNyW01i66lnu5DIQxAJR +oAM/TJpVarzBAPdCq0wBw0i08AyYYnIUzj8fulDZIZvQC/03lFrA9NJo0Hoh0Rh4laa0F /ZBzJqN+L7ZpzTpgsslDrvo6ILNdJg/yw64nJh+JhvYZk6FWnjfOyTJ6YuMFbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729241107; a=rsa-sha256; cv=none; b=alm4mhi/5TyT6iQHeidcJ9jFK0/Q44Yz1pYl7iVMRgP89c6Bd22jN5b2dPD4+252MPjbx2 +hPRPc9nNnkjAHMpJrp4qzHglt9lYEBmPOyESQs3gKwkWrKqfyFk0JrTe5HhCrYEAnDJ7N y9Wx3duQcRsmgTSlq6LFjmOJkw8yzPwei5PFBAVaXiV8Df4476Ce+fGo7qijqQg6ziEVlx XBXZ0NbhWvPbSRa2lCOzld0ipiPPEL5PCguTgfhxOcBcW3K7aaFNequk/abNovGFgwUwzS MfI9FkGTSp9dZTKhWfjsniQsD+vJ5RifUOnYDdDL+S1Lao2p+AHRujMaMGtPxA== 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 4XVJDg3fxSzRm9; Fri, 18 Oct 2024 08:45:07 +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 49I8j76N088461; Fri, 18 Oct 2024 08:45:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49I8j7B0088458; Fri, 18 Oct 2024 08:45:07 GMT (envelope-from git) Date: Fri, 18 Oct 2024 08:45:07 GMT Message-Id: <202410180845.49I8j7B0088458@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: aaf84d0e9683 - main - 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/main X-Git-Reftype: branch X-Git-Commit: aaf84d0e96831cd886b8e1e4ae102b3ba703b90a Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=aaf84d0e96831cd886b8e1e4ae102b3ba703b90a commit aaf84d0e96831cd886b8e1e4ae102b3ba703b90a Author: Christos Margiolis AuthorDate: 2024-10-18 08:41:16 +0000 Commit: Christos Margiolis CommitDate: 2024-10-18 08:41:16 +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 --- 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 c42cb1d7a90c..fbfb69de2913 100644 --- a/sys/dev/sound/midi/midi.c +++ b/sys/dev/sound/midi/midi.c @@ -950,12 +950,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);