summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAchal Verma <achalv@nvidia.com>2021-08-06 08:59:11 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2021-08-12 15:24:50 -0400
commit866ba8d085b43f2815bb4621576c3cb1a531922c (patch)
treebf621075852361cb0bc7e6a2a3dd63a77e83238a /drivers
parent603a8031494660c40271862bd303a388d80378b0 (diff)
tegra-camera: Fix potential NULL ptr dereference
This fix coverity issue : 9741833, 9741834 Bug 200741055 Change-Id: I0d6ab11a32fb7f29430adfe28c54a7b2b2a22698 Signed-off-by: Achal Verma <achalv@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2571929 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Dmitry Pervushin <dpervushin@nvidia.com> Reviewed-by: Amrita Deshmukh <amritad@nvidia.com> GVS: Gerrit_Virtual_Submit (cherry picked from commit 954e8d421ec24359a64542dd2777267b3d9bdb81) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2574546 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Phoenix Jung <pjung@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/platform/tegra/camera/tests/sensor_dt_test.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/media/platform/tegra/camera/tests/sensor_dt_test.c b/drivers/media/platform/tegra/camera/tests/sensor_dt_test.c
index d1d696c4a..045700975 100644
--- a/drivers/media/platform/tegra/camera/tests/sensor_dt_test.c
+++ b/drivers/media/platform/tegra/camera/tests/sensor_dt_test.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * sensor_dt_test - sensor device tree test 2 * sensor_dt_test - sensor device tree test
3 * 3 *
4 * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -907,8 +907,10 @@ int sensor_verify_dt(struct device_node *node, const u32 tvcf_version)
907 err = sv_dt_verify_full_dt(node, root_node); 907 err = sv_dt_verify_full_dt(node, root_node);
908 908
909sv_fail: 909sv_fail:
910 sv_dt_free_node(root_node); 910 if (root_node)
911 sv_dt_free_node(modeX_node); 911 sv_dt_free_node(root_node);
912 if (modeX_node)
913 sv_dt_free_node(modeX_node);
912 914
913 if (err == 0) 915 if (err == 0)
914 camtest_log(KERN_INFO "Sensor DT test passed\n"); 916 camtest_log(KERN_INFO "Sensor DT test passed\n");