mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-27 22:51:31 +00:00
wireless: cw1200: Fix memory leak in cw1200_wow_suspend()
Fix a memory leak in the cw1200_wow_suspend() error handling path. Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
2c323058bc
commit
47acf6f544
1 changed files with 6 additions and 5 deletions
|
@ -225,7 +225,7 @@ int cw1200_wow_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
|
||||||
cw1200_set_pm(priv, &priv->powersave_mode);
|
cw1200_set_pm(priv, &priv->powersave_mode);
|
||||||
if (wait_event_interruptible_timeout(priv->ps_mode_switch_done,
|
if (wait_event_interruptible_timeout(priv->ps_mode_switch_done,
|
||||||
!priv->ps_mode_switch_in_progress, 1*HZ) <= 0) {
|
!priv->ps_mode_switch_in_progress, 1*HZ) <= 0) {
|
||||||
goto revert3;
|
goto revert4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,11 +254,11 @@ int cw1200_wow_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
|
||||||
|
|
||||||
/* Stop serving thread */
|
/* Stop serving thread */
|
||||||
if (cw1200_bh_suspend(priv))
|
if (cw1200_bh_suspend(priv))
|
||||||
goto revert4;
|
goto revert5;
|
||||||
|
|
||||||
ret = timer_pending(&priv->mcast_timeout);
|
ret = timer_pending(&priv->mcast_timeout);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto revert5;
|
goto revert6;
|
||||||
|
|
||||||
/* Store suspend state */
|
/* Store suspend state */
|
||||||
pm_state->suspend_state = state;
|
pm_state->suspend_state = state;
|
||||||
|
@ -280,9 +280,9 @@ int cw1200_wow_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
revert5:
|
revert6:
|
||||||
WARN_ON(cw1200_bh_resume(priv));
|
WARN_ON(cw1200_bh_resume(priv));
|
||||||
revert4:
|
revert5:
|
||||||
cw1200_resume_work(priv, &priv->bss_loss_work,
|
cw1200_resume_work(priv, &priv->bss_loss_work,
|
||||||
state->bss_loss_tmo);
|
state->bss_loss_tmo);
|
||||||
cw1200_resume_work(priv, &priv->join_timeout,
|
cw1200_resume_work(priv, &priv->join_timeout,
|
||||||
|
@ -291,6 +291,7 @@ int cw1200_wow_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
|
||||||
state->direct_probe);
|
state->direct_probe);
|
||||||
cw1200_resume_work(priv, &priv->link_id_gc_work,
|
cw1200_resume_work(priv, &priv->link_id_gc_work,
|
||||||
state->link_id_gc);
|
state->link_id_gc);
|
||||||
|
revert4:
|
||||||
kfree(state);
|
kfree(state);
|
||||||
revert3:
|
revert3:
|
||||||
wsm_set_udp_port_filter(priv, &cw1200_udp_port_filter_off);
|
wsm_set_udp_port_filter(priv, &cw1200_udp_port_filter_off);
|
||||||
|
|
Loading…
Reference in a new issue