From b284ab0c11569bbddd972abd051f43d8923ec05d Mon Sep 17 00:00:00 2001 From: Mohan Kumar Date: Fri, 10 Feb 2023 14:14:30 +0530 Subject: [PATCH] ASoC: tegra: Fix coverity issue Fix the unchecked return error from of_property_read_u32 function. CID 10162254 Bug 3952896 Change-Id: Ifaa0cfc275e7a70896fd1f41ed12fcffd76395bd Signed-off-by: Mohan Kumar Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2856343 Reviewed-by: svcacv Reviewed-by: Sameer Pujar Reviewed-by: Sharad Gupta GVS: Gerrit_Virtual_Submit --- sound/soc/tegra/tegra_asoc_machine.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/tegra/tegra_asoc_machine.c b/sound/soc/tegra/tegra_asoc_machine.c index 0976e539..4ba2a5ef 100644 --- a/sound/soc/tegra/tegra_asoc_machine.c +++ b/sound/soc/tegra/tegra_asoc_machine.c @@ -2,7 +2,7 @@ /* * tegra_asoc_machine.c - Tegra DAI links parser * - * Copyright (c) 2014-2022 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2023 NVIDIA CORPORATION. All rights reserved. * */ @@ -501,8 +501,10 @@ static int parse_dt_dai_links(struct snd_soc_card *card, asoc_simple_canonicalize_platform(dai_link->platforms, dai_link->cpus); - of_property_read_u32(link_node, "link-type", - &link_type); + if (of_property_read_u32(link_node, "link-type", + &link_type) < 0) + goto cleanup; + switch (link_type) { case PCM_LINK: dai_link->ops = pcm_ops;