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

Commit 4f5555b9 authored by Jeyaprakash Soundrapandian's avatar Jeyaprakash Soundrapandian Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: sync: Validate state of sync object in sync signal" into dev/msm-4.9-camx

parents cc22cbd8 12bc50c5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -254,6 +254,12 @@ int cam_sync_signal(int32_t sync_obj, uint32_t status)
		signalable_row = sync_dev->sync_table + list_info->sync_obj;

		spin_lock_bh(&sync_dev->row_spinlocks[list_info->sync_obj]);
		if (signalable_row->state == CAM_SYNC_STATE_INVALID) {
			spin_unlock_bh(
				&sync_dev->row_spinlocks[list_info->sync_obj]);
			continue;
		}

		/* Dispatch kernel callbacks if any were registered earlier */
		list_for_each_entry_safe(sync_cb,
			temp_sync_cb, &signalable_row->callback_list, list) {
+4 −0
Original line number Diff line number Diff line
@@ -306,6 +306,10 @@ int cam_sync_deinit_object(struct sync_table_row *table, uint32_t idx)
	row->state = CAM_SYNC_STATE_INVALID;
	memset(row, 0, sizeof(*row));
	clear_bit(idx, sync_dev->bitmap);
	INIT_LIST_HEAD(&row->callback_list);
	INIT_LIST_HEAD(&row->parents_list);
	INIT_LIST_HEAD(&row->children_list);
	INIT_LIST_HEAD(&row->user_payload_list);
	spin_unlock_bh(&sync_dev->row_spinlocks[idx]);

	return 0;