asoc: codecs: add null check before access

Add null check before accessing cable status.

Change-Id: I77d19f543cf56ffaa159c490ea4df1f8c5a0f272
Signed-off-by: Lakshman Chaluvaraju <lchalu@codeaurora.org>
This commit is contained in:
Lakshman Chaluvaraju 2021-07-13 16:29:55 +05:30
commit 2f778a077d

View file

@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
*/
#include <linux/platform_device.h>
#include <linux/slab.h>
@ -222,9 +222,9 @@ static int msm_ext_disp_audio_type_get(struct snd_kcontrol *kcontrol,
rc = msm_ext_disp_select_audio_codec(codec_data->ext_disp_core_pdev,
&codec_info);
if (!codec_data->ext_disp_ops.get_audio_edid_blk ||
if (!codec_data->ext_disp_ops.cable_status ||
!codec_data->ext_disp_ops.get_intf_id || rc) {
dev_err_ratelimited(component->dev, "%s: get_audio_edid_blk() or get_intf_id is NULL\n",
dev_err_ratelimited(component->dev, "%s: cable_status() or get_intf_id is NULL\n",
__func__);
rc = -EINVAL;
goto cable_err;