From 6ccef15c0db666fe23d70dcd8d227fc43cc80fc5 Mon Sep 17 00:00:00 2001 From: Achal Verma Date: Wed, 12 May 2021 12:56:30 +0530 Subject: tegra-dc: Check ptr against NULL before access. This fix coverity issue: 2907007 Bug 200741055 Change-Id: Ib79759e5b2dc83bdf77e659a30a0d9f891e2a899 Signed-off-by: Achal Verma Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2528297 Reviewed-by: svcacv Reviewed-by: Dmitry Pervushin Reviewed-by: Rahul Jain (SW-TEGRA) GVS: Gerrit_Virtual_Submit Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2575322 Tested-by: mobile promotions Reviewed-by: svc-mobile-coverity Reviewed-by: Phoenix Jung Reviewed-by: mobile promotions --- drivers/video/tegra/dc/of_dc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/video/tegra/dc/of_dc.c b/drivers/video/tegra/dc/of_dc.c index a90538156..de8acdc02 100644 --- a/drivers/video/tegra/dc/of_dc.c +++ b/drivers/video/tegra/dc/of_dc.c @@ -1,7 +1,7 @@ /* * of_dc.c: tegra dc of interface. * - * Copyright (c) 2013-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2013-2021, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -2865,7 +2865,7 @@ struct tegra_dc_platform_data *of_dc_parse_platform_data( case TEGRA_DC_OUT_FAKE_DP: case TEGRA_DC_OUT_HDMI: case TEGRA_DC_OUT_DP: - if (dc->current_topology.conn_inst == 0) { + if (dc && dc->current_topology.conn_inst == 0) { pdata->conn_np = of_find_node_by_path("/host1x/sor"); } else { -- cgit v1.2.2