From patchwork Thu Jan 15 11:43:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 5638691 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F29DB9F665 for ; Thu, 15 Jan 2015 11:43:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 397BB2012E for ; Thu, 15 Jan 2015 11:43:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C3BB2010C for ; Thu, 15 Jan 2015 11:43:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753477AbbAOLnZ (ORCPT ); Thu, 15 Jan 2015 06:43:25 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:46923 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752394AbbAOLnY (ORCPT ); Thu, 15 Jan 2015 06:43:24 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t0FBh5W8003831 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 15 Jan 2015 11:43:06 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t0FBh4YU024137 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 15 Jan 2015 11:43:05 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t0FBh3tP000167; Thu, 15 Jan 2015 11:43:03 GMT Received: from mwanda (/154.0.139.178) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 15 Jan 2015 03:43:02 -0800 Date: Thu, 15 Jan 2015 14:43:40 +0300 From: Dan Carpenter To: Kalle Valo , Ram Amrani Cc: Eliad Peller , "John W. Linville" , Arik Nemtsov , Johannes Berg , David Spinadel , Luciano Coelho , linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] wlcore: unlock on error in wl1271_op_suspend() Message-ID: <20150115114340.GC17976@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We recently introduced a new error path which needs an unlock. Fixes: 6d5a748d4836 ('wlcore: add ability to reduce FW interrupts during suspend') Signed-off-by: Dan Carpenter --- Static checker fix. It's possible that wl1271_ps_elp_wakeup() unlocks on error but I didn't see it, and that would be an ugly API. -- 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/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index e90fb78..02f0e86 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -1785,8 +1785,10 @@ static int wl1271_op_suspend(struct ieee80211_hw *hw, mutex_lock(&wl->mutex); ret = wl1271_ps_elp_wakeup(wl); - if (ret < 0) + if (ret < 0) { + mutex_unlock(&wl->mutex); return ret; + } wl->wow_enabled = true; wl12xx_for_each_wlvif(wl, wlvif) {