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

Commit 9d29e4d3 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: synx: fix synx_release_core race condition"

parents 255a99c3 a823779f
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
 */
#define pr_fmt(fmt) "synx: " fmt

@@ -450,10 +450,10 @@ static int synx_release_core(struct synx_table_row *row)
	 * (definitely for merged synx on invoing deinit)
	 * be carefull while accessing the metadata
	 */
	mutex_lock(&synx_dev->row_locks[row->index]);
	fence = row->fence;
	idx = row->index;
	if (!idx) {
	mutex_lock(&synx_dev->row_locks[idx]);
	fence = row->fence;
	if ((!idx) || (!fence)) {
		mutex_unlock(&synx_dev->row_locks[idx]);
		pr_err("object already cleaned up at %d\n", idx);
		return -EINVAL;