All of lore.kernel.org
 help / color / mirror / Atom feed
From: mnlife <mnlife@126.com>
To: broonie@kernel.org, lgirdwood@gmail.com, alsa-devel@alsa-project.org
Cc: mnlife@126.com
Subject: [PATCH] ASoC: soc-jack: calling snd_soc_jack_report causes a null pointer access
Date: Fri, 11 Aug 2023 22:25:11 +0800	[thread overview]
Message-ID: <20230811142511.6570-1-mnlife@126.com> (raw)

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

Signed-off-by: mnlife <mnlife@126.com>
---
 sound/soc/soc-jack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index f951acb2ce362..b2cc13b9c77b7 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -37,7 +37,7 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
 	struct snd_soc_jack_pin *pin;
 	unsigned int sync = 0;
 
-	if (!jack)
+	if (!jack || !jack->jack)
 		return;
 	trace_snd_soc_jack_report(jack, mask, status);
 
-- 
2.25.1


             reply	other threads:[~2023-08-14 14:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-11 14:25 mnlife [this message]
2023-08-15 18:09 ` [PATCH] ASoC: soc-jack: calling snd_soc_jack_report causes a null pointer access Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2020-07-19  3:08 mnlife qiao
     [not found] <tencent_2D17145034BA02B43C169473C02C4257AF06@qq.com>
2020-07-19  2:52 ` mnlife qiao
2020-07-18 14:56 mnlife
     [not found] <5f0e49da.1c69fb81.1ede7.a8fbSMTPIN_ADDED_MISSING@mx.google.com>
2020-07-15  0:24 ` mnlife qiao
2020-07-16 22:29   ` Mark Brown
2020-07-16 22:29     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230811142511.6570-1-mnlife@126.com \
    --to=mnlife@126.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.