From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB614268FE9; Tue, 8 Apr 2025 11:07:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744110450; cv=none; b=rzjCYUrisQuGDXCU6alTy6ozg+GlaoVz093lLhVqU9R6kJwt8HAipLMDfxcCScSZKU6a6Yec+a1hi47aMTpSkGHHeOFSh1YscDMsS1cTHxii6zDtUmPn6TgIMVRULaICN/zSPvgT4l5xmV6bDOZDKJJoL7qWp4kQ1CsqDTgMl80= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744110450; c=relaxed/simple; bh=uJfWc63nVws9rW32hfRGy1IRHNqdUGORuacrqi3GJB0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eqpbuJ/P4YEy4E5ZXjwxXm4rlaXzHt6tjNCv/IMQByrragLM3QRfaYM8KDqKgqxQ9r0EY12JeeB3u8Q88gFE2Y0d3XyKVoJYMq5tNybnM2HsUfrvIGioWGFJHKoCNa2UCubc5s5DkOxFhcxqCtudIWHDbfRfI/RW0l2/1x3B8fM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MXwyKIqh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="MXwyKIqh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDA82C4CEE5; Tue, 8 Apr 2025 11:07:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744110450; bh=uJfWc63nVws9rW32hfRGy1IRHNqdUGORuacrqi3GJB0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MXwyKIqhLoj0Ewnj/jzYklfm5eckiJtRsFJE38+QiNr8oBlns8pHwpy7GqEKp9LUi bwUYfBJ7imVC6i5PSzpYIdP66jbjwssB0yh3wn4SWSkehW2M8cHEJDovIAPkjY30VJ DUh8jRIiVm6q4zbZafov+NErAUNwHLX4LURYwIHc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Thuan Nguyen , Detlev Casanova , Kuninori Morimoto , Mark Brown , Sasha Levin Subject: [PATCH 6.14 068/731] ASoC: simple-card-utils: Dont use __free(device_node) at graph_util_parse_dai() Date: Tue, 8 Apr 2025 12:39:25 +0200 Message-ID: <20250408104915.854167967@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250408104914.247897328@linuxfoundation.org> References: <20250408104914.247897328@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kuninori Morimoto [ Upstream commit de74ec718e0788e1998eb7289ad07970e27cae27 ] commit 419d1918105e ("ASoC: simple-card-utils: use __free(device_node) for device node") uses __free(device_node) for dlc->of_node, but we need to keep it while driver is in use. Don't use __free(device_node) in graph_util_parse_dai(). Fixes: 419d1918105e ("ASoC: simple-card-utils: use __free(device_node) for device node") Reported-by: Thuan Nguyen Reported-by: Detlev Casanova Signed-off-by: Kuninori Morimoto Tested-by: Thuan Nguyen Tested-by: Detlev Casanova Link: https://patch.msgid.link/87eczisyhh.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/generic/simple-card-utils.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index c2445c5ccd84c..32efb30c55d69 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -1077,6 +1077,7 @@ static int graph_get_dai_id(struct device_node *ep) int graph_util_parse_dai(struct device *dev, struct device_node *ep, struct snd_soc_dai_link_component *dlc, int *is_single_link) { + struct device_node *node; struct of_phandle_args args = {}; struct snd_soc_dai *dai; int ret; @@ -1084,7 +1085,7 @@ int graph_util_parse_dai(struct device *dev, struct device_node *ep, if (!ep) return 0; - struct device_node *node __free(device_node) = of_graph_get_port_parent(ep); + node = of_graph_get_port_parent(ep); /* * Try to find from DAI node @@ -1126,8 +1127,10 @@ int graph_util_parse_dai(struct device *dev, struct device_node *ep, * if he unbinded CPU or Codec. */ ret = snd_soc_get_dlc(&args, dlc); - if (ret < 0) + if (ret < 0) { + of_node_put(node); return ret; + } parse_dai_end: if (is_single_link) -- 2.39.5