Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>
Subject: Applied "ASoC: cs43130: Fix possible Oops with invalid dev_id" to the asoc tree
Date: Mon, 04 Sep 2017 15:49:41 +0100	[thread overview]
Message-ID: <E1dosh3-0006VK-NP@debutante> (raw)
In-Reply-To: <20170904131445.32438-1-tiwai@suse.de>

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

The patch

   ASoC: cs43130: Fix possible Oops with invalid dev_id

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From f31877a16b0926dea4d1d9b72917a3eca9be19b6 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Mon, 4 Sep 2017 15:54:47 +0200
Subject: [PATCH] ASoC: cs43130: Fix possible Oops with invalid dev_id
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

As compiler spotted out, there is the potential NULL-dereference in
the code when dc-measure OF is given for other than 43130/43131:
  sound/soc/codecs/cs43130.c:2089:18: warning: ‘hpload_seq’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Warn it and return before triggering Oops.

Fixes: 8f1e5bf9b440 ("ASoC: cs43130: Add support for CS43130 codec")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/cs43130.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
index 9f1aa0516fd0..4229a95e2859 100644
--- a/sound/soc/codecs/cs43130.c
+++ b/sound/soc/codecs/cs43130.c
@@ -2079,6 +2079,10 @@ static void cs43130_imp_meas(struct work_struct *wk)
 	case CS43131_CHIP_ID:
 		hpload_seq = hpload_seq2;
 		seq_size = ARRAY_SIZE(hpload_seq2);
+		break;
+	default:
+		WARN(1, "Invalid dev_id for meas: %d", cs43130->dev_id);
+		return;
 	}
 
 	i = 0;
-- 
2.14.1


[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



      parent reply	other threads:[~2017-09-04 14:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-04 13:14 [PATCH 1/2] ASoC: cs43130: Fix possible Oops with invalid dev_id Takashi Iwai
2017-09-04 13:14 ` [PATCH 2/2] ASoC: cs43130: Fix unused compiler warnings for PM runtime Takashi Iwai
2017-09-04 13:52   ` Takashi Iwai
2017-09-04 14:49 ` Mark Brown [this message]

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=E1dosh3-0006VK-NP@debutante \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox