From 55fbb0ef0229e518bd51a65813e390426e20d250 Mon Sep 17 00:00:00 2001 From: Bhalchandra Gajare <gajare@codeaurora.org> Date: Tue, 22 Jul 2014 17:27:03 -0700 Subject: [PATCH] ASoC: wcd_cpe_core: Fix handling of CPE SSR event It is possible that CPE block on the codec might not be enabled and SSR event is triggerred, in such cases the CPE is not initialized and the core handle to CPE is expected to be NULL. Fix the CPE SSR handling to make sure SSR handling does not proceed if the core handle is NULL. CRs-fixed: 698888 Change-Id: Ie525568765d5fb2a0bc0bf33c6da2a5d1b713d20 Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org> --- sound/soc/codecs/wcd_cpe_core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/codecs/wcd_cpe_core.c b/sound/soc/codecs/wcd_cpe_core.c index 87ebf5724a6e..73a680bb5b23 100644 --- a/sound/soc/codecs/wcd_cpe_core.c +++ b/sound/soc/codecs/wcd_cpe_core.c @@ -715,6 +715,12 @@ int wcd_cpe_ssr_event(void *core_handle, { struct wcd_cpe_core *core = core_handle; + if (!core) { + pr_err("%s: Invalid handle to core\n", + __func__); + return -EINVAL; + } + dev_dbg(core->dev, "%s: Schedule ssr work, event = %d\n", __func__, core->ssr_type); -- GitLab