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

Commit f4e12015 authored by Shyam Kumar Thella's avatar Shyam Kumar Thella
Browse files

power: fg-alg: Fix double mutex lock when capacity learning aborts



When capacity learning is aborted, mutex_lock() is called twice instead
of mutex_unlock() at the end. Fix it.

Change-Id: I9b967bffafc031968fce4fbfc484dc4b2f6a45b1
Signed-off-by: default avatarShyam Kumar Thella <sthella@codeaurora.org>
parent ecc41e9b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
 */

#define pr_fmt(fmt)	"ALG: %s: " fmt, __func__
@@ -714,7 +714,7 @@ void cap_learning_abort(struct cap_learning *cl)
	pr_debug("Aborting cap_learning\n");
	cl->active = false;
	cl->init_cap_uah = 0;
	mutex_lock(&cl->lock);
	mutex_unlock(&cl->lock);
}

/**