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

Commit fcc777ae authored by Yue Ma's avatar Yue Ma
Browse files

cnss2: Ignore recovery if driver state is not proper



If WLAN host driver has already been unloaded, there is no need
to handle recovery. Add the check to make sure it exits from the
recovery.

Change-Id: Ia97c4cfe4b80ed8e046d041903842655bb915714
Signed-off-by: default avatarYue Ma <yuem@codeaurora.org>
parent dc37d460
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1508,8 +1508,14 @@ static int cnss_driver_recovery_hdlr(struct cnss_plat_data *plat_priv,
		    cnss_recovery_reason_to_str(recovery_data->reason),
		    recovery_data->reason);

	if (!plat_priv->driver_state) {
		cnss_pr_err("Improper driver state, ignore recovery\n");
		ret = -EINVAL;
		goto out;
	}

	if (test_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state)) {
		cnss_pr_err("Recovery is already in progress!\n");
		cnss_pr_err("Recovery is already in progress\n");
		ret = -EINVAL;
		goto out;
	}