Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	dmurphy@ti.com
Cc: alsa-devel@alsa-project.org
Subject: [PATCH 02/22] ASoC: tas2552: Fix kernel crash when the codec is loaded but not part of a card
Date: Thu, 4 Jun 2015 15:22:26 +0300	[thread overview]
Message-ID: <1433420571-5421-3-git-send-email-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <1433420571-5421-1-git-send-email-peter.ujfalusi@ti.com>

If the card is not part of any card the tas_data->codec is NULL since it is
set only during snd_soc_codec_driver.probe, which is not yet called.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/codecs/tas2552.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c
index ff82f46ba504..df89947f1032 100644
--- a/sound/soc/codecs/tas2552.c
+++ b/sound/soc/codecs/tas2552.c
@@ -120,6 +120,9 @@ static void tas2552_sw_shutdown(struct tas2552_data *tas_data, int sw_shutdown)
 {
 	u8 cfg1_reg;
 
+	if (!tas_data->codec)
+		return;
+
 	if (sw_shutdown)
 		cfg1_reg = 0;
 	else
-- 
2.4.2

  parent reply	other threads:[~2015-06-04 12:23 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-04 12:22 [PATCH 00/22] ASoC: tas2552: Fixes, cleanups and improvements Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 01/22] ASoC: tas2552: Make the enable-gpio really optional Peter Ujfalusi
2015-06-04 12:22 ` Peter Ujfalusi [this message]
2015-06-04 12:22 ` [PATCH 03/22] ASoC: tas2552: Fix kernel crash caused by wrong kcontrol entry Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 04/22] ASoC: tas2552: Correct PDM configuration register bit definitions Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 05/22] ASoC: tas2552: Correct CFG1 " Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 06/22] ASoC: tas2552: Simplify the tas2552_mute function Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 07/22] ASoC: tas2552: Simplify and reverse the functionality of tas2552_sw_shutdown Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 08/22] ASoC: tas2552: Rename mclk parameter to pll_clkin to match with the datasheet Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 09/22] DT/sound: bindings header file for tas2552 codec Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 10/22] ASoC: tas2552: Add support for pll and pdm source clock selection Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 11/22] ASoC: tas2552: Correct dai format support Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 12/22] ASoC: tas2552: Correct and clean up data format and BCLK/WCLK direction Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 13/22] ASoC: tas2552: Add TDM support Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 14/22] ASoC: tas2552: Clean up the Digital - Analog DAPM route definition Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 15/22] ASoC: tas2552: Correct the Speaker Driver Playback Volume (PGA_GAIN) Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 16/22] ASoC: tas2552: Implement startup/stop sequence as per TRM Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 17/22] ASoC: tas2552: Add support for word length configuration Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 18/22] ASoC: tas2552: Configure the WCLK frequency based on the stream Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 19/22] ASoC: tas2552: Add control for selecting DIN source Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 19/23] ASoC: tas2552: Correct the PLL configuration Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 20/23] ASoC: tas2552: Add control for selecting DIN source Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 20/22] ASoC: tas2552: Correct Output Data register usage Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 21/22] ASoC: tas2552: Correct Boost Auto-Pass Through Control " Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 21/23] ASoC: tas2552: Correct Output Data " Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 22/22] ASoC: tas2552: Code, define alignment changes for uniformity Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 22/23] ASoC: tas2552: Correct Boost Auto-Pass Through Control register usage Peter Ujfalusi
2015-06-04 12:22 ` [PATCH 23/23] ASoC: tas2552: Code, define alignment changes for uniformity Peter Ujfalusi
2015-06-04 12:34 ` [PATCH 00/22] ASoC: tas2552: Fixes, cleanups and improvements Peter Ujfalusi

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=1433420571-5421-3-git-send-email-peter.ujfalusi@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=dmurphy@ti.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox