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

Commit 38aa2b9e authored by Aditya Bavanari's avatar Aditya Bavanari
Browse files

dsp: Fix improper mutex unlock in afe close



During SSR use cases, when AFE APR handle is NULL
and AFE close is invoked, mutex unlock is done without
locking. Fix it and bail out without unlocking the
mutex in this scenario.

Change-Id: Ia2988b56425d8c2d5c726d5860c13e655e7e4ed1
Signed-off-by: default avatarAditya Bavanari <abavanar@codeaurora.org>
parent 6f7624ea
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
 */
 */
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/debugfs.h>
#include <linux/debugfs.h>
@@ -8412,8 +8412,7 @@ int afe_close(int port_id)
		    (port_id == RT_PROXY_DAI_001_TX))
		    (port_id == RT_PROXY_DAI_001_TX))
			proxy_afe_instance[port_id & 0x1] = 0;
			proxy_afe_instance[port_id & 0x1] = 0;
		afe_close_done[port_id & 0x1] = true;
		afe_close_done[port_id & 0x1] = true;
		ret = -EINVAL;
		return -EINVAL;
		goto fail_cmd;
	}
	}
	pr_info("%s: port_id = 0x%x\n", __func__, port_id);
	pr_info("%s: port_id = 0x%x\n", __func__, port_id);
	if ((port_id == RT_PROXY_DAI_001_RX) ||
	if ((port_id == RT_PROXY_DAI_001_RX) ||