Merge "cnss2: Ignore recovery if driver state is not proper"

This commit is contained in:
Linux Build Service Account 2018-01-09 15:40:11 -08:00 committed by Gerrit - the friendly Code Review server
commit 14aa89ff45

View file

@ -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 * 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 * 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), cnss_recovery_reason_to_str(recovery_data->reason),
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)) { 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; ret = -EINVAL;
goto out; goto out;
} }