diff mbox series

When snd_soc_card_jack_new is not called or the call fails, calling this function causes a null pointer access

Message ID tencent_AA2F5D7A5EDC40E7E806D0CA5877CE8AB308@qq.com (mailing list archive)
State New, archived
Headers show
Series When snd_soc_card_jack_new is not called or the call fails, calling this function causes a null pointer access | expand

Commit Message

mnlife qiao July 14, 2020, 2:30 p.m. UTC
Signed-off-by: mnlife <mnlife@foxmail.com&gt;

---
&nbsp;sound/soc/soc-jack.c | 2 +-
&nbsp;1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index 0f1820f36b4d..51b799ee98b7 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -44,7 +44,7 @@  void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
&nbsp;unsigned int sync = 0;
&nbsp;int enable;
&nbsp;
-if (!jack)
+if (!jack || !jack-&gt;jack)
&nbsp;return;
&nbsp;trace_snd_soc_jack_report(jack, mask, status);
&nbsp;