From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 D225C41227D for ; Fri, 10 Jul 2026 12:47:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783687660; cv=none; b=gb4y1sK99RW1Ryz6WG7tm56x1x+iG9lOey9EcD1ZWGYx7v0K/zYW2y/XJid6MczjJQ835R4GWwkzN3vBG8Kkbw/DmD6uf05qrprYSZQQ2+6SB2PFEUqaftVrebHMqFqN3Eg2vTafoBK+aesE3C2bBzbh5n9ttoV7SMEqdhDhKNg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783687660; c=relaxed/simple; bh=hV28IQmsVQS7SKHRo7rdmqenY7Bknj2kwcKONVApwww=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=p5qGb1+W7WEbk9lPgei+Z0XZMukw6leNHTCOgeJ23KjEscVCv1VwYOeAcujrFTx33zLlo70xGpGroRU8rcpLwE6GqqYRa4lHm+x/+AfvRgkqbE7pZ1gn04+TaccwdxLUF5tL0JGqipjqpMaqtGUJDuYfmSzFvVZn5Vs8BOGHwIY= 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=PSFGV0c4; arc=none smtp.client-ip=209.85.128.44 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="PSFGV0c4" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-493ce08a75bso2940235e9.1 for ; Fri, 10 Jul 2026 05:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1783687656; x=1784292456; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=OlYQ+J/8rYdsqc6eGhUahr3U27QhOh0SgcXLrXVQ3Qo=; b=PSFGV0c4/ms23bew6pGongM/3tIIr4W34Kk7PQ9PD9MFD2Ahv/Ct7tEqtdbLSPwprt LPNO/cNgg+UbKZ85rbyWocc08xcvRdg6UbMlwyfmlgrcPciT56NZ/F7NoWAqsKJtw7WH BeXuPESViIVluPXoVUWzzs9EAEYPaVRi1bvU6ljw/l+jzTdNLKzCuiLXOTwnzQnaTpFI xR/wVHEetLhSRX4CjJzLu3BgM/KNKXZfucP75yYIClJPUHH0wJbn9H6aP5Nq7Ij0nzxr XQEZaPdt7a19/GADJzd+Wb1x/z9EM5bm7RacLfFMMDtGna8JCz3xgIOE7EkqMPWnVFms 4uuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783687656; x=1784292456; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=OlYQ+J/8rYdsqc6eGhUahr3U27QhOh0SgcXLrXVQ3Qo=; b=CfSWvfy7VGt6t+rj7q5yhjiBCz7uJIJdWLeSVWG7/v3Ykf17q2wljGMls6EbOS5Znl aKIVv3ZVUqqhquXZFLO5djEBY8vz8CHzw8pZE7d3MexotyzOd2Yq5cEUq+jxsoJdYBI8 +evTRnMFyvj9RJ8wv7h3T6bAb17JPbyo0tChyDvREKSg1KyXrp/jcz562DfciKKB++TV 6wmmAobw4ZeG4ERG61vOELy9AN3pxMpD9hlzEd/P3n9/Y0zNEiWk/TmQbs+6+4wIOhjv 6tvhovTqCXZRIMJ1g+yDa4oUSFWBqgr85k/yxXixw9bEDw+tJwqY8lhgmkoeUEXsqz8D 9U7g== X-Gm-Message-State: AOJu0YwM8sGwLxQ3bGFbwb+4ecBhS8HyKPKjujIaj2io8zi4SctOf3X4 4+jBSrmxChaSYwYAkLdWW+RgLUFEMCCdsqIYgZD8tYBPShAn1w7lAo9jCDY51+ZOpLo= X-Gm-Gg: AfdE7cnLbvb56SU2Y8Z+U4hfvP8H78Eq+SbzLuPQKI1CIDXdbDRadBZH/nA+mDhMSp3 Tx0DFBI7+h17Y7V1tjJzPzqDigEhZs4XiVTYOK4U/GFA59fBCEVYls1ZJAtKBQqD2hhaMeav7Wp 7CN+GJ10jozhssHcOGxmdVW+YRi54iFYuntweqVlxr5sOR7+J0wGiMkZ6Z6IgJdb6XyFe0kzS+r C4lUIdudN9BYSmiMeR1sCZbWsjtR4hbGeqXMhtU0NePGXj+E/+Kt87Gt48rQEyKoukYoxLgun03 yiBqJW80lxDsvHCphFcAB/REZBSESbxp/r71pxzw+vQPM0zxSbwR3lCf3BGOg1plmwoARx79YT9 Qcim/RdjJk9tXUZ29yIy+NCyFFnybtsuW6z1RPHLKFTaPD0CwtPj/JfYByUhiutWR+XhJ4I/mqn NI2Lcn1TVLydej2IM= X-Received: by 2002:a05:600c:4455:b0:493:bb0e:2832 with SMTP id 5b1f17b1804b1-493e687fb61mr114586355e9.37.1783687656144; Fri, 10 Jul 2026 05:47:36 -0700 (PDT) Received: from [192.168.3.100] ([151.41.178.17]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f273195d9sm3834312f8f.3.2026.07.10.05.47.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jul 2026 05:47:35 -0700 (PDT) Message-ID: <191ee2b4-d552-49ab-aebb-58da970087a1@baylibre.com> Date: Fri, 10 Jul 2026 14:47:34 +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 Content-Language: en-US To: Markus Elfring , Ethan Tidmore , linux-sound@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Jerome Brunet , Liam Girdwood , Mark Brown Cc: LKML , Jaroslav Kysela , Kevin Hilman , Martin Blumenstingl , Neil Armstrong , Takashi Iwai References: <76386ed2-b7dc-441a-b9ea-80ab26c54d52@web.de> From: Valerio Setti In-Reply-To: <76386ed2-b7dc-441a-b9ea-80ab26c54d52@web.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 7/10/26 1:27 PM, Markus Elfring wrote: > … >>> +++ 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, … > > I doubt it. > > How can a snd_soc_unregister_component(dev) call ever fit to a failed > snd_soc_register_component() call (according to the presented suggestion)? > https://elixir.bootlin.com/linux/v7.2-rc1/source/sound/soc/meson/aiu.c#L240-L315 The reply was based on the fact that looking at 'snd_soc_unregister_component' that's a macro for 'snd_soc_unregister_component_by_driver'. The latter cycles through all registered components and if nothing is found related to the given dev, then it results in a no-op. So calling 'snd_soc_unregister_component' on a failed 'snd_soc_register_component' looked harmless to me. What did I miss? -- Valerio