Skip to contentSkip to conversation

ASoC: soc-jack: calling snd_soc_jack_report causes a null pointer access

PATCH New mnlife qiao 1 participant 1 message Jul 19, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 ASoC: soc-jack: calling snd_soc_jack_report causes a null pointer access

Quoted 27 lines

From: mnlife <[email protected]>

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

---
 sound/soc/soc-jack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/soc-jack.c +1 -2
index 0f1820f36b4d..51b799ee98b7 100644
@@ -44,7 +44,7 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
        unsigned int sync = 0;
        int enable;
 
-       if (!jack)
+       if (!jack || !jack->jack)
                return;
        trace_snd_soc_jack_report(jack, mask, status);
 
--

2.17.1