diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2025-04-14 03:45:59 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2025-04-14 13:48:36 +0300 |
commit | 2b4ce994afca0690ab79b7860045e6883e8706db (patch) | |
tree | 92a27b47330d72c188c5b0579ca1b1db92f2dd04 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 2c6b6a3e8b9338e7ddbbd699f3cb085fbc78413a (diff) | |
download | linux-2b4ce994afca0690ab79b7860045e6883e8706db.tar.xz |
ASoC: simple-card-utils: fixup dlc->xxx handling for error case
Current graph_util_parse_dai() has 2 issue for dlc->xxx handling.
1) dlc->xxx might be filled if snd_soc_get_dai_via_args() (A) works.
In such case it will fill dlc->xxx first (B), and detect error
after that (C). We need to fill dlc->xxx in success case only.
(A) dai = snd_soc_get_dai_via_args(&args);
if (dai) {
ret = -ENOMEM;
^ dlc->of_node = ...
(B) dlc->dai_name = ...
v dlc->dai_args = ...
(C) if (!dlc->dai_args)
goto end;
...
}
2) graph_util_parse_dai() itself has 2 patterns (X)(Y) to fill dlc->xxx.
Both case, we need to call of_node_put(node) (Z) in error case, but we
are calling it only in (Y) case.
int graph_util_parse_dai(...)
{
...
dai = snd_soc_get_dai_via_args(&args);
if (dai) {
...
^ dlc->of_node = ...
(X) dlc->dai_name = ...
v dlc->dai_args = ...
...
}
...
(Y) ret = snd_soc_get_dlc(&args, dlc);
if (ret < 0) {
(Z) of_node_put(node);
...
}
...
}
This patch fixup both case. Make it easy to understand, update
lavel "end" to "err", too.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87fribr2ns.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions