Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7a2c47f authored by Lakshman Chaluvaraju's avatar Lakshman Chaluvaraju
Browse files

asoc: codecs: add null check before access



Add null check before accessing cable status.

Change-Id: I77d19f543cf56ffaa159c490ea4df1f8c5a0f272
Signed-off-by: default avatarLakshman Chaluvaraju <lchalu@codeaurora.org>
parent de549a6f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
// 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(component->dev, "%s: get_audio_edid_blk() or get_intf_id is NULL\n",
		dev_err(component->dev, "%s: cable_status() or get_intf_id is NULL\n",
			__func__);
		rc = -EINVAL;
		goto cable_err;