Message ID | 87a5a8qo5y.wl-kuninori.morimoto.gx@renesas.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | ASoC: simple-card-utils fixups | expand |
On Wed, Feb 26, 2025 at 11:30:49PM +0000, Kuninori Morimoto wrote: > 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") This isn't applying against my 6.14 branch, it's got a dependency on some of the changes in -next unfortunately. Could you rebase onto for-6.14 please?
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 51e0e434514d..79fdd57a470c 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -1102,6 +1102,7 @@ static int graph_get_dai_id(struct device_node *ep) int graph_util_parse_dai(struct simple_util_priv *priv, struct device_node *ep, struct snd_soc_dai_link_component *dlc, int *is_single_link) { + struct device_node *node; struct device *dev = simple_priv_to_dev(priv); struct of_phandle_args args = {}; struct snd_soc_dai *dai; @@ -1110,7 +1111,7 @@ int graph_util_parse_dai(struct simple_util_priv *priv, 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 @@ -1153,8 +1154,10 @@ int graph_util_parse_dai(struct simple_util_priv *priv, 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); goto end; + } parse_dai_end: if (is_single_link)