The patch fixes spinlock priv->lock (apm_ops.init) is used before it has
been initialized.
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
static int iwl4965_apm_init(struct iwl_priv *priv)
{
- unsigned long flags;
int ret = 0;
- spin_lock_irqsave(&priv->lock, flags);
iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS,
CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER);
iwl_release_nic_access(priv);
out:
- spin_unlock_irqrestore(&priv->lock, flags);
return ret;
}
int ret;
/* nic_init */
- priv->cfg->ops->lib->apm_ops.init(priv);
-
spin_lock_irqsave(&priv->lock, flags);
+ priv->cfg->ops->lib->apm_ops.init(priv);
iwl_write32(priv, CSR_INT_COALESCING, 512 / 32);
spin_unlock_irqrestore(&priv->lock, flags);