diff mbox

[v2,1/2] ASoC: atmel: sam9x5_wm8731: fix oops when unload module

Message ID 1385546710-11308-1-git-send-email-voice.shen@atmel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bo Shen Nov. 27, 2013, 10:05 a.m. UTC
As the priv is not assigned to card->drvdata, it is NULL, so when
unload module, it will cause NULL pointer oops.
Assign priv to card->drvdata to fix this issue.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
Change in v2: 
  - using snd_soc_card_set_drvdata()
---
 sound/soc/atmel/sam9x5_wm8731.c |    2 ++
 1 file changed, 2 insertions(+)

Comments

Mark Brown Nov. 27, 2013, 3:50 p.m. UTC | #1
On Wed, Nov 27, 2013 at 06:05:09PM +0800, Bo Shen wrote:
> As the priv is not assigned to card->drvdata, it is NULL, so when
> unload module, it will cause NULL pointer oops.
> Assign priv to card->drvdata to fix this issue.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/atmel/sam9x5_wm8731.c b/sound/soc/atmel/sam9x5_wm8731.c
index 992ae38..1b37228 100644
--- a/sound/soc/atmel/sam9x5_wm8731.c
+++ b/sound/soc/atmel/sam9x5_wm8731.c
@@ -97,6 +97,8 @@  static int sam9x5_wm8731_driver_probe(struct platform_device *pdev)
 		goto out;
 	}
 
+	snd_soc_card_set_drvdata(card, priv);
+
 	card->dev = &pdev->dev;
 	card->owner = THIS_MODULE;
 	card->dai_link = dai;