2013-02-22 13:32:22

by Wei Yongjun

[permalink] [raw]
Subject: [PATCH -next] brcmfmac: fix missing unlock on error in brcmf_notify_vif_event()

From: Wei Yongjun <[email protected]>

Add the missing unlock before return from function brcmf_notify_vif_event()
in the error handling case.

Signed-off-by: Wei Yongjun <[email protected]>
---
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index cecc3ef..2af9c0f 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;




2013-02-25 01:19:49

by Wei Yongjun

[permalink] [raw]
Subject: [PATCH -next v2] brcmfmac: fix missing unlock on error in brcmf_notify_vif_event()

From: Wei Yongjun <[email protected]>

Add the missing unlock before return from function brcmf_notify_vif_event()
in the error handling case.

Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Wei Yongjun <[email protected]>
Acked-by: Arend van Spriel <[email protected]>
---
v1 -> v2: add Reported-by and Acked-by
---
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index cecc3ef..2af9c0f 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;







2013-02-22 13:50:20

by Arend van Spriel

[permalink] [raw]
Subject: Re: [PATCH -next] brcmfmac: fix missing unlock on error in brcmf_notify_vif_event()

On 02/22/2013 02:32 PM, Wei Yongjun wrote:
> From: Wei Yongjun <[email protected]>
>
> Add the missing unlock before return from function brcmf_notify_vif_event()
> in the error handling case.

We have a fix for this one, but not yet submitted. This issue was:

Reported-by: Dan Carpenter <[email protected]>

If you add that to the commit message, you have my:
Acked-by: Arend van Spriel <[email protected]>
> Signed-off-by: Wei Yongjun <[email protected]>
> ---
> drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)

Regards,
Arend