From nobody Mon Jul 29 15:35:22 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 4WXj9Q30VNz5RSZk; Mon, 29 Jul 2024 15:35:22 +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 4WXj9Q19xbz42RH; Mon, 29 Jul 2024 15:35:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267322; 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=61pkL3vGSqVcsJ7bwTTrOazXQxrM2GPKZwTCPORcknk=; b=oCPnIKAESRT0Io9Qu6IY+Z5tTegRzxBYDGDbIntCPV3+zgrawAci/ujTzRTFGncg9/vjCE 6U7Za7mJ2cvGzrUo5lvSq7q2wwVwuBnq38QMuDMuEVcUngpiKpwMaVeLJX3kYUmntxAI3Y WhnbS+2Rod3+L9h1mcYwEJryyjMA6c2yrjR6fGaetcHY6nty6p8olh2qKBk+ydfqcLl6di psX2rJrdSxG6sPwlQ0DM+fjNc87s+bw/SyDaEV8whue9wKd1fj917n341lyZg4lmYzzNz8 8xYO7uowPcQZ0I+/Uq8pPwGQ117t99OLMTSUQBsKeYYSkOM6uUz+leoz+DVCiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267322; a=rsa-sha256; cv=none; b=dOqMmxFkMslPLznxmSfKr9peUcpnESnTLKmSHAbvVnnI7LT3VgLWi0lt5JfbVQFgTpF4v6 Ap6sJGdnjD3YexIXS6G4DM/Hiiq5yYAnARvyyzqbYx0HjW4MfXqg0RfFFVvHvpbMpH3ajn uDHJoWiaYAglsGwvIsSRYM5c4M6/Jl5bBzvq2ymlfDm6ppt+vq7odSx9h/NstyMzbIwkGR oFdWIYzNt2uuI61SR2MqwKQ2tbK3MYBHJUW4QiPnmFaDphymaRK5hcXnFahvCF+Icf4BVa 6eubd76FWiEvoST7igPAaLglSkhmOleDN95ofXwDBCeY3Jt2D3UGYeHMsvdH4Q== 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=1722267322; 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=61pkL3vGSqVcsJ7bwTTrOazXQxrM2GPKZwTCPORcknk=; b=gchmrfQWrVQNfDOyGKHwEOZuNtrMEuV09uFeqGQ7Z4Nbn8asOgM8ZcO85ewJYmAlb66NHn zC3nRmpE5RddvYq60O+V0WSwibPPP79+nmUT+/MuZ8HYOYZvFlCmxdtHX1RlPQxk8R8DqV AyWM5n0HMwYpK9pdULuEgvZWced1dYKmqBemaTE+mS7gxHJj8AZMoqrU8VgUusrZw6RKRq FpFJvNfqCelmXIAKtYVReUt9JRfI2vjFbXLvfPHjLSL46HXEzqe4CEMoI6iHRrC81LjToY WX30IPqYDBDRU9slQZlCTqsZ3gAofOs95coazevtQg/hDvYQJIEi3epv+6GnEA== 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 4WXj9Q0n0tzgDJ; Mon, 29 Jul 2024 15:35:22 +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 46TFZMNB002494; Mon, 29 Jul 2024 15:35:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TFZM42002491; Mon, 29 Jul 2024 15:35:22 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:22 GMT Message-Id: <202407291535.46TFZM42002491@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: 6716cc7e2768 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 6716cc7e276816c693647dbfa643fcd110a42f81 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6716cc7e276816c693647dbfa643fcd110a42f81 commit 6716cc7e276816c693647dbfa643fcd110a42f81 Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:19 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:54 +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 (cherry picked from commit 16329b7b3276f09dc70bdd1ca8bc605546fe71e0) --- 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);