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

Commit b3c4ee24 authored by Harsh Shah's avatar Harsh Shah
Browse files

msm: camera: sync: Change the sync state first



First thing to do when starting deinit should be to change the
state to INVALID. Many other places rely on this state to avoid
processing and hence avoid race.

Change-Id: I402b15573c5fb4229d6c006a32f55ab3608d476f
Signed-off-by: default avatarHarsh Shah <harshs@codeaurora.org>
parent 11af628b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -215,6 +215,7 @@ int cam_sync_deinit_object(struct sync_table_row *table, uint32_t idx)
		spin_unlock_bh(&sync_dev->row_spinlocks[idx]);
		return -EINVAL;
	}
	row->state = CAM_SYNC_STATE_INVALID;

	/* Object's child and parent objects will be added into this list */
	INIT_LIST_HEAD(&temp_child_list);
@@ -303,7 +304,6 @@ int cam_sync_deinit_object(struct sync_table_row *table, uint32_t idx)
		kfree(sync_cb);
	}

	row->state = CAM_SYNC_STATE_INVALID;
	memset(row, 0, sizeof(*row));
	clear_bit(idx, sync_dev->bitmap);
	spin_unlock_bh(&sync_dev->row_spinlocks[idx]);