alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: soc-jack: calling snd_soc_jack_report causes a null pointer access
@ 2020-07-18 14:56 mnlife
  0 siblings, 0 replies; 7+ messages in thread
From: mnlife @ 2020-07-18 14:56 UTC (permalink / raw)
  To: lgirdwood, Jaroslav Kysela, open list, mnlife qiao, alsa-devel
  Cc: nmlife.qiao@gmail.com, mnlife qiao

[-- Attachment #1: Type: text/plain, Size: 705 bytes --]

From: mnlife <mnlife@foxmail.com> 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@foxmail.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 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)      unsigned int sync = 0;      int enable; -     if (!jack) +     if (!jack || !jack->jack)           return;      trace_snd_soc_jack_report(jack, mask, status); -- 2.17.1 .

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ASoC-soc-jack-calling-snd_soc_jack_report-causes-a-n.patch --]
[-- Type: text/x-diff; name="0001-ASoC-soc-jack-calling-snd_soc_jack_report-causes-a-n.patch", Size: 912 bytes --]

From 1cd6ed8cd1c8518d6bd30bdc0b1cf998a3abe32d Mon Sep 17 00:00:00 2001
From: mnlife <mnlife@foxmail.com>
Date: Fri, 10 Jul 2020 21:31:08 +0800
Subject: [PATCH] ASoC: soc-jack: calling snd_soc_jack_report causes a null
 pointer access
Content-Type: text/plain; charset="utf-8"

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@foxmail.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 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)
 	unsigned int sync = 0;
 	int enable;
 
-	if (!jack)
+	if (!jack || !jack->jack)
 		return;
 	trace_snd_soc_jack_report(jack, mask, status);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread
[parent not found: <tencent_2D17145034BA02B43C169473C02C4257AF06@qq.com>]
* [PATCH] ASoC: soc-jack: calling snd_soc_jack_report causes a null pointer access
@ 2020-07-19  3:08 mnlife qiao
  0 siblings, 0 replies; 7+ messages in thread
From: mnlife qiao @ 2020-07-19  3:08 UTC (permalink / raw)
  To: lgirdwood, perex, linux-kernel, alsa-devel, mnlife

From: mnlife <mnlife@foxmail.com>

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@foxmail.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 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)
 	unsigned int sync = 0;
 	int enable;
 
-	if (!jack)
+	if (!jack || !jack->jack)
 		return;
 	trace_snd_soc_jack_report(jack, mask, status);
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] ASoC: soc-jack: calling snd_soc_jack_report causes a null pointer access
@ 2023-08-11 14:25 mnlife
  2023-08-15 18:09 ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: mnlife @ 2023-08-11 14:25 UTC (permalink / raw)
  To: broonie, lgirdwood, alsa-devel; +Cc: mnlife

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-08-15 18:11 UTC | newest]

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).