From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 694B33E8337 for ; Tue, 7 Jul 2026 20:34:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783456444; cv=none; b=aPp0aHxM3W5J5QJuTQXdx9ki0w0qD2TcHctVBMfAbGAq0ICttW1L5mqTFnDsJn2b2y4CAyD9bvXU7T6Qeet96bL8+7NNKLCvyGhikPiwBAXeQ9g6tP/zZO6slNAWiJ1VKMKLqVMzlT10PRahmdbfQgcIj2SxiqejZpJX0E9HiLY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783456444; c=relaxed/simple; bh=7Q2ZE6HLS75wQcm83WzmDpbetkihWwx9rkK1yd3soGY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IB2klK+zb5PQF6YHvf7KEbbIz/l/7SP+K/e4AMmtrs0ld0ZquGTrpxjXa/soCBfomFwgunSCBHBJAXXfIPkAp9Tduwtmp7Zjcx0+PhleR0BpX06k+269fEk/8wG+V/UaE1nUv9TwPS1AM1ZIrQ/+I6Vk1oMVvb88MCSgC0dGdIw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=FUkxT16K; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="FUkxT16K" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-47db714766aso587284f8f.0 for ; Tue, 07 Jul 2026 13:34:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1783456440; x=1784061240; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=O11o5MEN33Vh1fP73gT+0ZVa3EZdhEdLDt6jcZLOEk0=; b=FUkxT16KfwwlT9dDxKb/b/764qMeeDH3rYhqHt94TNH2Jw4qY5Cu1kss0a4oRvX9DZ LaD7EjIvX23D49ftXMU+Jt6Y87V/QhgYCnY/m/pbNnDhe30ttwGniJADYRVOabYHih7z xtPaU6Atf1B4e1QExmKAcYQrF62BzdiZPXUH4Jqr0b21TfgQj/mxcs/IemCrrAy1Ue5F /NyZYLnJiZaKgqDvE567SLtSxUjRShYuqZNntW8gEoLQiYfdeIMf9HM30/vj4+R+C4Au 5awoQFq4D8aR7U5+Fba8GSfkmyagzShjvSPu+4QDwpJuVeo7L9H34h/yWTb5ir7ZHwbK Ot8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783456440; x=1784061240; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=O11o5MEN33Vh1fP73gT+0ZVa3EZdhEdLDt6jcZLOEk0=; b=Wq3KTk4GqfOrXQtjeBFMiKDCv/Pos2y9Zpl0UzusIZHiPhnR+BW2h+ExSEqQZDm/uq W1zU+zKBK3kXgHHwoijcwOMsKh7eGL/mZjEXe+CTUKsvDkbwyivaL4uZ9w0iYOkrQecM K04ZwppDXSSnzS6Vh+LH7fmeaCo5BYWbyQK2L5uolQ+rLJysJ8yvr8YBuwE6O8rrU6zh lGZMdEOwWVBB47X9nFY29geKVImg2DI+Kt12sEudm6CLdOoXZ/hyHIEuYth+NAsk0p+c SictobfgAo3At52q/0QkZRwCXQ9RWmzXuS1nYmXEG0P0HsDkeaA8qzbEPj2K5w67gGim iDrA== X-Forwarded-Encrypted: i=1; AHgh+Rqz5jxt/zKdS+F4OreV5yzgY5c9rKmc71EPru+0/2o2RnZHyg6QBV2DuHEHqhyhQ/6XPZ3oJdUOj5cXTD4=@vger.kernel.org X-Gm-Message-State: AOJu0YxdW3tNadQePWo5zSlHuLDC2loWMqyR8NUgOENr8JdsrWCpEQMA xJ3DQnITUuUyIdCjhMhA3QzJtCLz21o4kONmvWRqSJeLpPH2EhwpmO9wJOZvGq1ZA4Q= X-Gm-Gg: AfdE7cmC+kYvzHpB/qKC49KF0XNRCdItrWXSAfnvGCk7oD+I6aWX/JbsKnKdLXhj8ny ONEtP7/HEggFHTT2Qs8uualwbVPGSKmF5EsdGDflffsbxhe49uBzfLaFu4NYsF2DHYuKZw5eCjD vPqHYxJ8+tEUdYKj5cm5kfXrrnw66dWfT3rEi/S1A7nlVQOFgrdz5f0EtDvcD3jlgrS5g8V9iNx XBveN2le3f6RER62iof+P1giO/C0I3p8EYga4m6boKORTIsWWAcRzxHEvZeV7HdBPmu8MeFGdi9 0WLmrk/eHToROL5B2PVhZOOpMtyqQT59umMPpiSLoMs2opsNp1K7gtulE5OT0ds+d+KcSmnQRcG qaDqyWkPoHOVXvF2iqydJYVMoFJFV16G2a0OuB3vqR0EjVN9+naZBAxguoNnzNJMl8NAic4t/Hb dgTvpeYuALj2XDEQg= X-Received: by 2002:a05:6000:2891:b0:475:f0c2:75b2 with SMTP id ffacd0b85a97d-47de9a41059mr5106546f8f.29.1783456439812; Tue, 07 Jul 2026 13:33:59 -0700 (PDT) Received: from [192.168.3.100] ([151.41.178.17]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47a9de1d8f1sm36801444f8f.3.2026.07.07.13.33.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jul 2026 13:33:59 -0700 (PDT) Message-ID: Date: Tue, 7 Jul 2026 22:33:58 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] ASoC: meson: aiu: Fix resource leak To: Ethan Tidmore , Jerome Brunet , Liam Girdwood , Mark Brown Cc: Jaroslav Kysela , Takashi Iwai , Neil Armstrong , Kevin Hilman , Martin Blumenstingl , linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org References: <20260707012424.1661733-1-ethantidmore06@gmail.com> Content-Language: en-US From: Valerio Setti In-Reply-To: <20260707012424.1661733-1-ethantidmore06@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/7/26 3:24 AM, Ethan Tidmore wrote: > In snd_soc_register_component() error path, the aiu-formatter is not > being freed. Instead of returning now goto the err tag so the > aiu-formatter can properly be freed. > > Fixes: 83b83024cdbfd ("ASoC: meson: aiu: use aiu-formatter-i2s to format I2S output data") > Signed-off-by: Ethan Tidmore > --- > sound/soc/meson/aiu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sound/soc/meson/aiu.c b/sound/soc/meson/aiu.c > index 64ace4d25d92..d6b644a53f7e 100644 > --- a/sound/soc/meson/aiu.c > +++ b/sound/soc/meson/aiu.c > @@ -310,7 +310,7 @@ static int aiu_probe(struct platform_device *pdev) > ARRAY_SIZE(aiu_cpu_dai_drv)); > if (ret) { > dev_err(dev, "Failed to register cpu component\n"); > - return ret; > + goto err; > } > > /* Register the hdmi codec control component */ Technically the fix is OK, but I don't think the commit title and message are correct. aiu-formatter data is allocated in 'gx_formatter_create' using 'devm_kzalloc' so, unless I'm missing something, the data should be automatically freed when the device is removed in case of error. What 'gx_formatter_free' does is simply clearing widget's private pointer (i.e. 'w->priv'). I think that not clearing it should not have any bad consequence since the pointer would be overwritten on the next probe. However I agree that for consistency reasons it's a good thing to clear to do when 'aiu_probe' fails. So perhaps the title should be rewritten to something like "ASoC: meson: aiu: reset widget private data on probe error path"? -- Valerio