Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2311642ybc; Wed, 20 Nov 2019 12:07:08 -0800 (PST) X-Google-Smtp-Source: APXvYqw/mQ8wloKa9yIliiF4Vn50jvTtHgp5uiqRorkW1vTJ7KvMayJrLE4ZZKcNwP+pKROPQ4sg X-Received: by 2002:adf:f5cf:: with SMTP id k15mr974476wrp.265.1574280428595; Wed, 20 Nov 2019 12:07:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574280428; cv=none; d=google.com; s=arc-20160816; b=rEu5le90Nwa0W8bKYJuG55e/CQgFWgaI10cvV4AQGFIaSZ1tAargXGYt41Oo0s0Va7 3mj9B85PdCxQfZ3NpjqcHGeXPaRS4vT9eV0CbYETl0BrMp06mwF9b6eABnv7DraJW/Fk 10vwK5F3v/qlMP3Z/T4FWe4gkNXQyK6M869w2qN2wqQep0RGVaT0aFxBUDYjA8kiiC46 v3laxV3TUiJIKwEAC+R9yxcS/qvV90IFWcMZa60yyJnD/XuldG3JUB9Zb3FTziAIyfpV S9kBQYE05BiEYs5SajxM4fet178cqzTv6j0qAwl0Yd+Cu+ZPUihIyld1fZNhmxdIiwxb GwSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=/BrbftbFWasMQCZOxaeJSDA/mMFUqjylXrqmXGSrLzk=; b=B+boBK/Eht424PacyF/OegzvDSHCmKbvNtzSH5V4VmHaFd+Ef6MFIn9Tl4w8icMiQk K3ShXk5DNmz9A2pw5/IbnPApdc91L7GBuRnYCw6iNVsqvP5LOGkjB+CJc+2zzItT87Zn dquKoIxax38W9dlCgMlKBjhuhGj5loVOZzDLN8+kxQnQN7/0iNNO3Tj8sDlYe2K03c28 cuEWAthdFwPLEBPNXe4dANQUzV5WA+qLA8SzxeBquANHbR7Fx03OsyA4pJRW5iLa1PC/ y+1U5ji5HvJhvbqTTDtyQm+sp80J+1L0TzSLL4YL5akiRZrAgfe6gBFC6hqtWX9c+X8C GD3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i7si397267eda.375.2019.11.20.12.06.25; Wed, 20 Nov 2019 12:07:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727367AbfKTUFo (ORCPT + 99 others); Wed, 20 Nov 2019 15:05:44 -0500 Received: from smail.rz.tu-ilmenau.de ([141.24.186.67]:49556 "EHLO smail.rz.tu-ilmenau.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727085AbfKTUFn (ORCPT ); Wed, 20 Nov 2019 15:05:43 -0500 Received: from localhost.localdomain (unknown [141.24.207.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPSA id 0A0BA58007C; Wed, 20 Nov 2019 21:05:41 +0100 (CET) From: Markus Theil To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, Markus Theil Subject: [PATCH] mt76: fix fix ampdu locking Date: Wed, 20 Nov 2019 21:05:31 +0100 Message-Id: <20191120200531.11344-1-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The current ampdu locking code does not unlock its mutex in the early return case. This patch fixes it. Signed-off-by: Markus Theil --- drivers/net/wireless/mediatek/mt76/mt7603/main.c | 6 ++++-- drivers/net/wireless/mediatek/mt76/mt7615/main.c | 6 ++++-- drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/main.c b/drivers/net/wireless/mediatek/mt76/mt7603/main.c index 281387c3f4f4..962e2822d19f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/main.c @@ -569,6 +569,7 @@ mt7603_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 ssn = params->ssn; u8 ba_size = params->buf_size; struct mt76_txq *mtxq; + int ret = 0; if (!txq) return -EINVAL; @@ -597,7 +598,8 @@ mt7603_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, break; case IEEE80211_AMPDU_TX_START: mtxq->agg_ssn = IEEE80211_SN_TO_SEQ(ssn); - return IEEE80211_AMPDU_TX_START_IMMEDIATE; + ret = IEEE80211_AMPDU_TX_START_IMMEDIATE; + break; case IEEE80211_AMPDU_TX_STOP_CONT: mtxq->aggr = false; mt7603_mac_tx_ba_reset(dev, msta->wcid.idx, tid, -1); @@ -606,7 +608,7 @@ mt7603_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, } mutex_unlock(&dev->mt76.mutex); - return 0; + return ret; } static void diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c index 240dab919327..070b03403894 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c @@ -484,6 +484,7 @@ mt7615_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 tid = params->tid; u16 ssn = params->ssn; struct mt76_txq *mtxq; + int ret = 0; if (!txq) return -EINVAL; @@ -513,7 +514,8 @@ mt7615_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, break; case IEEE80211_AMPDU_TX_START: mtxq->agg_ssn = IEEE80211_SN_TO_SEQ(ssn); - return IEEE80211_AMPDU_TX_START_IMMEDIATE; + ret = IEEE80211_AMPDU_TX_START_IMMEDIATE; + break; case IEEE80211_AMPDU_TX_STOP_CONT: mtxq->aggr = false; mt7615_mcu_set_tx_ba(dev, params, 0); @@ -522,7 +524,7 @@ mt7615_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, } mutex_unlock(&dev->mt76.mutex); - return 0; + return ret; } const struct ieee80211_ops mt7615_ops = { diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c index f58a3ebfa9d2..dac383ee8f4f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c @@ -356,6 +356,7 @@ int mt76x02_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 tid = params->tid; u16 ssn = params->ssn; struct mt76_txq *mtxq; + int ret = 0; if (!txq) return -EINVAL; @@ -385,7 +386,8 @@ int mt76x02_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, break; case IEEE80211_AMPDU_TX_START: mtxq->agg_ssn = IEEE80211_SN_TO_SEQ(ssn); - return IEEE80211_AMPDU_TX_START_IMMEDIATE; + ret = IEEE80211_AMPDU_TX_START_IMMEDIATE; + break; case IEEE80211_AMPDU_TX_STOP_CONT: mtxq->aggr = false; ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); @@ -393,7 +395,7 @@ int mt76x02_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, } mutex_unlock(&dev->mt76.mutex); - return 0; + return ret; } EXPORT_SYMBOL_GPL(mt76x02_ampdu_action); -- 2.24.0