projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ff3b574
)
ASoC: rt5640: Fix NULL dereference on module unload
author
Dmitry Osipenko
<digetx@gmail.com>
Mon, 6 Jan 2020 01:47:07 +0000
(
04:47
+0300)
committer
Mark Brown
<broonie@kernel.org>
Mon, 6 Jan 2020 20:44:25 +0000
(20:44 +0000)
The rt5640->jack is NULL if jack is already disabled at the time of
driver's module unloading.
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link:
https://lore.kernel.org/r/20200106014707.11378-1-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5640.c
patch
|
blob
|
history
diff --git
a/sound/soc/codecs/rt5640.c
b/sound/soc/codecs/rt5640.c
index adbae1f36a8afb303b85ebdb5617e33ca6a4620c..747ca248bf10c9e4b1dc763ab25e3cffdefcde3c 100644
(file)
--- a/
sound/soc/codecs/rt5640.c
+++ b/
sound/soc/codecs/rt5640.c
@@
-2432,6
+2432,13
@@
static void rt5640_disable_jack_detect(struct snd_soc_component *component)
{
struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component);
+ /*
+ * soc_remove_component() force-disables jack and thus rt5640->jack
+ * could be NULL at the time of driver's module unloading.
+ */
+ if (!rt5640->jack)
+ return;
+
disable_irq(rt5640->irq);
rt5640_cancel_work(rt5640);