[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAGjHXR3kE00vcr04YOp1BYEHEzO-Ppdzs8qnF7_f06rNG1uxaA@mail.gmail.com>
Date: Sun, 19 Jul 2020 10:52:48 +0800
From: mnlife qiao <mnlife.qiao@...il.com>
To: lgirdwood@...il.com, Jaroslav Kysela <perex@...ex.cz>,
open list <linux-kernel@...r.kernel.org>,
alsa-devel@...a-project.org, mnlife <mnlife@...mail.com>,
mnlife qiao <mnlife.qiao@...il.com>
Subject: [PATCH] ASoC: soc-jack: calling snd_soc_jack_report causes a null
pointer access
> From: mnlife <mnlife@...mail.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@...mail.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
>
>
Powered by blists - more mailing lists