]> git.karo-electronics.de Git - linux-beck.git/commitdiff
sst: make register_sst_card more self-contained
authorLu Guanqun <guanqun.lu@intel.com>
Wed, 6 Apr 2011 02:20:42 +0000 (10:20 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 May 2011 19:51:58 +0000 (12:51 -0700)
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>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/intel_sst/intel_sst_drv_interface.c
drivers/staging/intel_sst/intelmid.c

index e9c182108243316bca5bc2fdf3b50d3733cdc971..971588ce26d3dd44ae5f726b427898e1676b3023 100644 (file)
@@ -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);
index d207636a7b6d9ffb28dfb22f5745df8ee4235bb5..2d4b94a8aa9dcce1a089fe3bbb2864ac4564b38e 100644 (file)
@@ -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;