summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorYue Ma <yuem@codeaurora.org>2017-12-11 16:11:52 -0800
committerYue Ma <yuem@codeaurora.org>2018-01-02 11:09:59 -0800
commitfcc777aeeb63bfbc4799125513008aebb74f59e9 (patch)
tree1c99e09d1e2121fe8038c7f534f2932ebbdc2660 /drivers/net
parentdc37d46038fb1c27458b8f7fe3af1e882f4c7bd3 (diff)
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: Yue Ma <yuem@codeaurora.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/cnss2/main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/wireless/cnss2/main.c b/drivers/net/wireless/cnss2/main.c
index 4d8ad7c8975f..5b218edad138 100644
--- a/drivers/net/wireless/cnss2/main.c
+++ b/drivers/net/wireless/cnss2/main.c
@@ -1,4 +1,4 @@
-/* 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;
}