diff --git a/sound/soc/codecs/sdm660_cdc/msm-digital-cdc.c b/sound/soc/codecs/sdm660_cdc/msm-digital-cdc.c index e64956aa2f40..d5ceff8e0b94 100644 --- a/sound/soc/codecs/sdm660_cdc/msm-digital-cdc.c +++ b/sound/soc/codecs/sdm660_cdc/msm-digital-cdc.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -2136,6 +2136,10 @@ static int msm_dig_suspend(struct device *dev) pr_debug("%s:digcodec not initialized, return\n", __func__); return 0; } + if (!registered_digcodec->component.card) { + pr_debug("%s:component not initialized, return\n", __func__); + return 0; + } pdata = snd_soc_card_get_drvdata(registered_digcodec->component.card); if (!pdata) { pr_debug("%s:card not initialized, return\n", __func__);