From nobody Sat Jul 27 11:56:24 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 4WWNPh4H5Zz5S6RC; Sat, 27 Jul 2024 11:56:24 +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 4WWNPh33Zvz434P; Sat, 27 Jul 2024 11:56:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081384; 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=KJN/AzifNMDuu9xONX4x5YMTI99t6Iw3E8uKjzoKlNE=; b=E/n5d1W4Y6pzUjeewr6t1cnkrXk3BiRMs0+ZrB/mBmfAXaEjDDSbEsRBirDywyREKbhBgh b0kNTj2DDu/sHDnxQk/ol5ueOIfdosVbXWol4WWd2eVLUvi0xZrtiMufwAzf5jMZk5jX4h LxN0o8nC9gb+rbukcpeAKIYKkxbxMdGVAww7AEPUgMDKLsmrNHQFh1OPZyULAntkRxkE+G Rc559IFycFrp/MXq3cL+cAn6DFgnIW8cobUaV+emiLYI1Ekn2QJP14R8rmevd3KJYaaQxs gB90KQot6W5PNJ4KP9KVg44GplGGWwn3zV6pnCkjVxO0iWGmGx6MZkECnejqKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081384; a=rsa-sha256; cv=none; b=qKa/UD+7x2OmSQsiqtZNHIJBF/kAuV2LwI+wmhGruOgg9PbhYF+Ms0YJ7Rdup5xlmZgs1e Uwpmoa7Ggf+5w3Y8DTqwfYTT4g7G6dsAAPvVEzBjJxqD+olz6f2c4z4aqKsaZyim1FnUJ5 YbqGCeMiRXXuqSKc5BYJltjpueEfqi1XyiJWSlXJcIhzMyst0YMwaaUN9aavqTKHq2iEpF XuAni55HTOfvGTVlIa6uaspQLRYdSxFYCQ2w9TC4ZrhXCGPBFQOkArXcTyiJ96Rixd71/l tjvntEF6xcZRj4mOgMnUuFHCtJGbw8OhDYYiVml8WKJZJwNqYV529DjVu9qmMg== 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=1722081384; 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=KJN/AzifNMDuu9xONX4x5YMTI99t6Iw3E8uKjzoKlNE=; b=LuAkX5NwiRjUrztrvlLlSTAdPcgx8H5qHf+YhrdnxJJ5clk/1/F4n0TD2DKVbLu8sy24LY X/NamqHg2W4mMDoAFW5tWrHsTJRBtgtS+iL22t3lixGRxTXxKmbAoemqUvwn75wFl1+jdw 31v4gmxp5LyGagiChocBnG3TmEn4f6BXVKFg4gBGHlj/GTB+UGpy58V5PXoimLUu9Bw3fc tU1EI+Hu5YH4DDaw6Qcg4QMkPH+knqvquCpPCFZw6yWgWlN9MX3Y8O9XrGmh5BuT+fzPYE FwbveLq7SswPxmoRE2RRkwmNYw42DzF8P95mC4mPDf8F/gPZys5qJ6ETUbq0GA== 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 4WWNPh2ghGz15YQ; Sat, 27 Jul 2024 11:56:24 +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 46RBuOCP039887; Sat, 27 Jul 2024 11:56:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuOuu039884; Sat, 27 Jul 2024 11:56:24 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:24 GMT Message-Id: <202407271156.46RBuOuu039884@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: 16329b7b3276 - main - sound: Fix memory leak in chn_init() 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: 16329b7b3276f09dc70bdd1ca8bc605546fe71e0 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=16329b7b3276f09dc70bdd1ca8bc605546fe71e0 commit 16329b7b3276f09dc70bdd1ca8bc605546fe71e0 Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:19 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:55:19 +0000 sound: Fix memory leak in chn_init() In case chn_init() fails, we are leaking memory by not freeing the feeder. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45979 --- sys/dev/sound/pcm/channel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index a18ef1cf4234..19808a43631a 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1365,6 +1365,8 @@ out2: if (CHN_LOCKOWNED(c)) CHN_UNLOCK(c); if (ret) { + while (chn_removefeeder(c) == 0) + ; if (c->devinfo) { if (CHANNEL_FREE(c->methods, c->devinfo)) sndbuf_free(b);