Change if logic to handle invalid case for operation_mode
at first avoiding an 'else' path.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (vwrq->power.disabled) {
priv->reg.power_mgmt = POWER_MGMT_ACTIVE;
} else {
- if (priv->reg.operation_mode == MODE_INFRASTRUCTURE)
- priv->reg.power_mgmt = POWER_MGMT_SAVE1;
- else
+ if (priv->reg.operation_mode != MODE_INFRASTRUCTURE)
return -EINVAL;
+ priv->reg.power_mgmt = POWER_MGMT_SAVE1;
}
hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST);