From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0E8CC433F5 for ; Tue, 16 Nov 2021 00:47:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0D6C63263 for ; Tue, 16 Nov 2021 00:47:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350623AbhKPAuB (ORCPT ); Mon, 15 Nov 2021 19:50:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:45214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344531AbhKOTY4 (ORCPT ); Mon, 15 Nov 2021 14:24:56 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 644F8633D4; Mon, 15 Nov 2021 18:59:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637002758; bh=+XnHw3g7g9D+RFsVTPRs+GWW8on9ZiD2JFN64wI7XZ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jB8qdlV5RuJU5fmhqi5sX8h9i822gUkSKzJj73WOHURMkC4dFmysBIVxRgkZP1q9T jCZ6L9effyn6q5j4Ohri7c/TPl9prn21gYpuW5EQ9zLJCKPsM6z5CVg44hVtUbA36d HZwjW8xPP7s1ElDIm+yXeJ2xgevnAqLcBd/Ao28k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Kuninori Morimoto , Mark Brown , Sasha Levin Subject: [PATCH 5.15 686/917] ASoC: rsnd: Fix an error handling path in rsnd_node_count() Date: Mon, 15 Nov 2021 18:03:01 +0100 Message-Id: <20211115165452.159744655@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211115165428.722074685@linuxfoundation.org> References: <20211115165428.722074685@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit 173632358fde7a567f28e07c4549b959ee857986 ] If we return before the end of the 'for_each_child_of_node()' iterator, the reference taken on 'np' must be released. Add the missing 'of_node_put()' call. Fixes: c413983eb66a ("ASoC: rsnd: adjust disabled module") Signed-off-by: Christophe JAILLET Reviewed-by: Kuninori Morimoto Link: https://lore.kernel.org/r/4c0e893cbfa21dc76c1ede0b6f4f8cff42209299.1634586167.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/sh/rcar/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 978bd0406729a..6a8fe0da7670b 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1225,6 +1225,7 @@ int rsnd_node_count(struct rsnd_priv *priv, struct device_node *node, char *name if (i < 0) { dev_err(dev, "strange node numbering (%s)", of_node_full_name(node)); + of_node_put(np); return 0; } i++; -- 2.33.0