From patchwork Mon Feb 25 01:19:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2179681 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 25AE2DF24C for ; Mon, 25 Feb 2013 01:19:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759466Ab3BYBTu (ORCPT ); Sun, 24 Feb 2013 20:19:50 -0500 Received: from mail-bk0-f54.google.com ([209.85.214.54]:39216 "EHLO mail-bk0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759457Ab3BYBTt (ORCPT ); Sun, 24 Feb 2013 20:19:49 -0500 Received: by mail-bk0-f54.google.com with SMTP id w5so1045647bku.41 for ; Sun, 24 Feb 2013 17:19:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=gYXtbb+5utH8m56zYoNvVlhLSKSvuFvIUIhmG7rX5HI=; b=Kxi5X34VpGunVCfS/9RYJ+SpvV9SddtqSO8En6daDYKTNM5pm4QJkTnbjWBjDmOJC2 gK9ZesgmkoJ/SR9Bi1OvKpjPLmMDsblCmDwtFt3v+Rg8Q6WQ+IYlGyg1h50fZliWOEQk 0drqJzyHOGx2kGYEH4Gq2IdE4xqY81D1o+PB8Du3ewSFrO9AL1N4AYV3UcG6FF4L3IpE TVgy/+k78H4qYujEWNbTX7I4SrjtlVuWIv1PhaaZgJNCd8Ey4foT+W2TLyWeTbF8D9+P 9CpSwL+enCPupIgyZaHR6YPzm+NhG79Osr1SrmnslyJbHd3pveNFP7ZV3iydGFYJ6OXA Wbww== MIME-Version: 1.0 X-Received: by 10.205.133.1 with SMTP id hw1mr4159550bkc.58.1361755187935; Sun, 24 Feb 2013 17:19:47 -0800 (PST) Received: by 10.204.30.210 with HTTP; Sun, 24 Feb 2013 17:19:47 -0800 (PST) In-Reply-To: <5127778F.8070005@broadcom.com> References: <5127778F.8070005@broadcom.com> Date: Mon, 25 Feb 2013 09:19:47 +0800 Message-ID: Subject: [PATCH -next v2] brcmfmac: fix missing unlock on error in brcmf_notify_vif_event() From: Wei Yongjun To: arend@broadcom.com Cc: brudley@broadcom.com, meuleman@broadcom.com, linville@tuxdriver.com, yongjun_wei@trendmicro.com.cn, linux-wireless@vger.kernel.org, brcm80211-dev-list@broadcom.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Wei Yongjun Add the missing unlock before return from function brcmf_notify_vif_event() in the error handling case. Reported-by: Dan Carpenter Signed-off-by: Wei Yongjun Acked-by: Arend van Spriel --- v1 -> v2: add Reported-by and Acked-by --- drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;