diff options
author | Lu Guanqun | 2011-04-06 10:20:42 +0800 |
---|---|---|
committer | Mark Brown | 2011-04-06 23:15:23 +0900 |
commit | 0ed625b2f2751c249417bd28694e37ef48eb5fbb (patch) | |
tree | 36268bb4b38c46b5ff5c4da1b25ad467456eea2b | |
parent | 83a3fd3cf0bfdadfdfc633f6437f9121e28252b9 (diff) |
sst: make register_sst_card more self-contained
register_sst_card is used in ASoC code with field `scard_ops` being NULL.
Without this patch, there will be NULL dereference.
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | drivers/staging/intel_sst/intel_sst_drv_interface.c | 1 | ||||
-rw-r--r-- | drivers/staging/intel_sst/intelmid.c | 1 |
2 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/intel_sst/intel_sst_drv_interface.c b/drivers/staging/intel_sst/intel_sst_drv_interface.c index ea8e251b5099..cf10dd606638 100644 --- a/drivers/staging/intel_sst/intel_sst_drv_interface.c +++ b/drivers/staging/intel_sst/intel_sst_drv_interface.c @@ -508,7 +508,6 @@ int register_sst_card(struct intel_sst_card_ops *card) sst_drv_ctx->pmic_state = SND_MAD_INIT_DONE; sst_drv_ctx->rx_time_slot_status = 0; /*default AMIC*/ card->pcm_control = sst_pmic_ops.pcm_control; - sst_drv_ctx->scard_ops->card_status = SND_CARD_UN_INIT; return 0; } else { pr_err("strcmp fail %s\n", card->module_name); diff --git a/drivers/staging/intel_sst/intelmid.c b/drivers/staging/intel_sst/intelmid.c index fb2292186703..1fb39d4f98e2 100644 --- a/drivers/staging/intel_sst/intelmid.c +++ b/drivers/staging/intel_sst/intelmid.c @@ -802,6 +802,7 @@ static int __devinit snd_intelmad_sst_register( pr_err("sst card registration failed\n"); return ret_val; } + sst_drv_ctx->scard_ops->card_status = SND_CARD_UN_INIT; sst_card_vendor_id = intelmaddata->sstdrv_ops->vendor_id; intelmaddata->pmic_status = PMIC_UNINIT; |