Skip to content

Commit

Permalink
sst: make register_sst_card more self-contained
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lu Guanqun authored and Mark Brown committed Apr 6, 2011
1 parent 83a3fd3 commit 0ed625b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion drivers/staging/intel_sst/intel_sst_drv_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/intel_sst/intelmid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0ed625b

Please sign in to comment.