From: Wei Yongjun Date: Fri, 22 Feb 2013 13:32:20 +0000 (+0800) Subject: brcmfmac: fix missing unlock on error in brcmf_notify_vif_event() X-Git-Tag: firefly_0821_release~3680^2~921^2~28^2^2~17 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=dc4a787c8f52f9d6e46156953f8014a3353bcbc7;p=firefly-linux-kernel-4.4.55.git brcmfmac: fix missing unlock on error in brcmf_notify_vif_event() Add the missing unlock before return from function brcmf_notify_vif_event() in the error handling case. Signed-off-by: Wei Yongjun Reported-by: Dan Carpenter Acked-by: Arend van Spriel Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index cecc3eff72e9..2af9c0f0798d 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c @@ -4615,8 +4615,10 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp, switch (ifevent->action) { case BRCMF_E_IF_ADD: /* waiting process may have timed out */ - if (!cfg->vif_event.vif) + if (!cfg->vif_event.vif) { + mutex_unlock(&event->vif_event_lock); return -EBADF; + } ifp->vif = vif; vif->ifp = ifp;