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

Commit af374fc4 authored by Ayush Kumar's avatar Ayush Kumar
Browse files

msm: camera: sync: Prevent spin lock recursion



This commit handle spin lock recursion when both the
parent sync object is same as one of its child object.

CRs-Fixed: 2629192
Change-Id: I524f8ff176250d6aa32b1a03797cfa7858147c51
Signed-off-by: default avatarAyush Kumar <ayushkr@codeaurora.org>
parent e824a782
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 */

#include "cam_sync_util.h"
@@ -72,6 +72,12 @@ int cam_sync_init_group_object(struct sync_table_row *table,
	 * If any child state is ERROR or SUCCESS, it will not be added to list.
	 */
	for (i = 0; i < num_objs; i++) {
		if (idx == sync_objs[i]) {
			CAM_ERR(CAM_SYNC,
				"Invalid, same as parent fence : %i", idx);
			rc = -EINVAL;
			goto clean_children_info;
		}
		child_row = table + sync_objs[i];
		spin_lock_bh(&sync_dev->row_spinlocks[sync_objs[i]]);