OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
724808a
)
ASoC: simple-card: fix an use-after-free in simple_for_each_link()
author
Wen Yang
<wen.yang99@zte.com.cn>
Wed, 10 Jul 2019 07:25:07 +0000
(15:25 +0800)
committer
Mark Brown
<broonie@kernel.org>
Wed, 10 Jul 2019 15:33:55 +0000
(16:33 +0100)
The codec variable is still being used after the of_node_put() call,
which may result in use-after-free.
Fixes:
d947cdfd4be2
("ASoC: simple-card: cleanup DAI link loop method - step1")
Link:
https://lore.kernel.org/r/1562743509-30496-3-git-send-email-wen.yang99@zte.com.cn
Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/generic/simple-card.c
patch
|
blob
|
history
diff --git
a/sound/soc/generic/simple-card.c
b/sound/soc/generic/simple-card.c
index
4117e54
..
ef84915
100644
(file)
--- a/
sound/soc/generic/simple-card.c
+++ b/
sound/soc/generic/simple-card.c
@@
-364,8
+364,6
@@
static int simple_for_each_link(struct asoc_simple_priv *priv,
goto error;
}
- of_node_put(codec);
-
/* get convert-xxx property */
memset(&adata, 0, sizeof(adata));
for_each_child_of_node(node, np)
@@
-387,11
+385,13
@@
static int simple_for_each_link(struct asoc_simple_priv *priv,
ret = func_noml(priv, np, codec, li, is_top);
if (ret < 0) {
+ of_node_put(codec);
of_node_put(np);
goto error;
}
}
+ of_node_put(codec);
node = of_get_next_child(top, node);
} while (!is_top && node);