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

Commit b06743ea authored by Vikram Sharma's avatar Vikram Sharma Committed by Sridhar Gujje
Browse files

msm: camera: isp: Check ife out res validity



This change adds validity check for ife out res. If ife out res is
NULL we can run into crash or issues.

CRs-Fixed: 2915741
Change-Id: I8722b2a4e2634bda42f0080e00bf09050bbd6b91
Signed-off-by: default avatarVikram Sharma <vikramsa@codeaurora.org>
parent 7305ccde
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
 */

#include <media/cam_defs.h>
@@ -140,6 +140,14 @@ static int cam_isp_update_dual_config(
		}

		hw_mgr_res = &res_list_isp_out[i];
		if (!hw_mgr_res) {
			CAM_ERR(CAM_ISP,
				"Invalid isp out resource i %d num_out_res %d",
				i, dual_config->num_ports);
			rc = -EINVAL;
			goto end;
		}

		for (j = 0; j < CAM_ISP_HW_SPLIT_MAX; j++) {
			if (!hw_mgr_res->hw_res[j])
				continue;