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

Commit 5864bc31 authored by Banajit Goswami's avatar Banajit Goswami
Browse files

ASoC: apq8084: add NULL pointer check for function return value



Add check for NULL pointer as return value from function before
dereferencing the pointer.

CRs-Fixed: 682545
Change-Id: I856f29e1f4a608e4de765a6b43214a55c896ef2f
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
parent 9ff7b179
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -4220,6 +4220,11 @@ static struct snd_soc_card *populate_snd_card_dailinks(struct device *dev)
	const struct of_device_id *match;

	match = of_match_node(apq8084_asoc_machine_of_match, dev->of_node);
	if (!match) {
		dev_err(dev, "%s: No DT match found for sound card\n",
			__func__);
		return NULL;
	}

	if (!strcmp(match->data, "tomtom_codec")) {
		card = &snd_soc_card_tomtom_apq8084;
@@ -4329,6 +4334,12 @@ static int apq8084_asoc_machine_probe(struct platform_device *pdev)

	match = of_match_node(apq8084_asoc_machine_of_match,
			      pdev->dev.of_node);
	if (!match) {
		dev_err(&pdev->dev, "%s: No DT match found for sound card\n",
			__func__);
		ret = -EINVAL;
		goto err;
	}
	if (!strcmp(match->data, "tomtom_codec"))
		mclk_freq_prop_name = "qcom,tomtom-mclk-clk-freq";
	else