From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Lorenzo Bianconi <lorenzo@kernel.org>,
Felix Fietkau <nbd@nbd.name>, Sasha Levin <sashal@kernel.org>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: [PATCH AUTOSEL 5.12 060/116] mt76: mt7915: always check return value from mt7915_mcu_alloc_wtbl_req
Date: Wed, 5 May 2021 12:30:28 -0400 [thread overview]
Message-ID: <20210505163125.3460440-60-sashal@kernel.org> (raw)
In-Reply-To: <20210505163125.3460440-1-sashal@kernel.org>
From: Lorenzo Bianconi <lorenzo@kernel.org>
[ Upstream commit 45f93e368211fbbd247e1ece254ffb121e20fa10 ]
As done for mt76_connac_mcu_alloc_wtbl_req, even if this is not a real
bug since mt7915_mcu_alloc_wtbl_req routine can fails just if nskb is NULL,
always check return value from mt7915_mcu_alloc_wtbl_req in order to avoid
possible future mistake.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index 195929242b72..12281e4cf817 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -1188,6 +1188,9 @@ mt7915_mcu_sta_ba(struct mt7915_dev *dev,
wtbl_hdr = mt7915_mcu_alloc_wtbl_req(dev, msta, WTBL_SET, sta_wtbl,
&skb);
+ if (IS_ERR(wtbl_hdr))
+ return PTR_ERR(wtbl_hdr);
+
mt7915_mcu_wtbl_ba_tlv(skb, params, enable, tx, sta_wtbl, wtbl_hdr);
ret = mt76_mcu_skb_send_msg(&dev->mt76, skb,
@@ -1704,6 +1707,9 @@ int mt7915_mcu_sta_update_hdr_trans(struct mt7915_dev *dev,
return -ENOMEM;
wtbl_hdr = mt7915_mcu_alloc_wtbl_req(dev, msta, WTBL_SET, NULL, &skb);
+ if (IS_ERR(wtbl_hdr))
+ return PTR_ERR(wtbl_hdr);
+
mt7915_mcu_wtbl_hdr_trans_tlv(skb, vif, sta, NULL, wtbl_hdr);
return mt76_mcu_skb_send_msg(&dev->mt76, skb, MCU_EXT_CMD(WTBL_UPDATE),
@@ -1728,6 +1734,9 @@ int mt7915_mcu_add_smps(struct mt7915_dev *dev, struct ieee80211_vif *vif,
wtbl_hdr = mt7915_mcu_alloc_wtbl_req(dev, msta, WTBL_SET, sta_wtbl,
&skb);
+ if (IS_ERR(wtbl_hdr))
+ return PTR_ERR(wtbl_hdr);
+
mt7915_mcu_wtbl_smps_tlv(skb, sta, sta_wtbl, wtbl_hdr);
return mt76_mcu_skb_send_msg(&dev->mt76, skb,
@@ -2253,6 +2262,9 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
wtbl_hdr = mt7915_mcu_alloc_wtbl_req(dev, msta, WTBL_RESET_AND_SET,
sta_wtbl, &skb);
+ if (IS_ERR(wtbl_hdr))
+ return PTR_ERR(wtbl_hdr);
+
if (enable) {
mt7915_mcu_wtbl_generic_tlv(skb, vif, sta, sta_wtbl, wtbl_hdr);
mt7915_mcu_wtbl_hdr_trans_tlv(skb, vif, sta, sta_wtbl, wtbl_hdr);
--
2.30.2
next prev parent reply other threads:[~2021-05-05 16:35 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-05 16:29 [PATCH AUTOSEL 5.12 001/116] ath11k: fix thermal temperature read Sasha Levin
2021-05-05 16:29 ` [PATCH AUTOSEL 5.12 011/116] tipc: convert dest node's address to network order Sasha Levin
2021-05-05 16:29 ` [PATCH AUTOSEL 5.12 013/116] net/mlx5e: Use net_prefetchw instead of prefetchw in MPWQE TX datapath Sasha Levin
2021-05-05 16:29 ` [PATCH AUTOSEL 5.12 014/116] net: stmmac: Set FIFO sizes for ipq806x Sasha Levin
2021-05-05 16:29 ` [PATCH AUTOSEL 5.12 016/116] Documentation: networking: switchdev: fix command for static FDB entries Sasha Levin
2021-05-05 16:29 ` [PATCH AUTOSEL 5.12 017/116] Bluetooth: Fix incorrect status handling in LE PHY UPDATE event Sasha Levin
2021-05-05 16:29 ` [PATCH AUTOSEL 5.12 023/116] Bluetooth: Set CONF_NOT_COMPLETE as l2cap_chan default Sasha Levin
2021-05-05 16:29 ` [PATCH AUTOSEL 5.12 024/116] Bluetooth: verify AMP hci_chan before amp_destroy Sasha Levin
2021-05-05 16:29 ` [PATCH AUTOSEL 5.12 025/116] Bluetooth: initialize skb_queue_head at l2cap_chan_create() Sasha Levin
2021-05-05 16:29 ` [PATCH AUTOSEL 5.12 026/116] net/sched: cls_flower: use ntohs for struct flow_dissector_key_ports Sasha Levin
2021-05-05 16:29 ` [PATCH AUTOSEL 5.12 027/116] net: bridge: when suppression is enabled exclude RARP packets Sasha Levin
2021-05-05 16:29 ` [PATCH AUTOSEL 5.12 028/116] Bluetooth: check for zapped sk before connecting Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 032/116] net: hns3: remediate a potential overflow risk of bd_num_list Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 033/116] net: hns3: add handling for xmit skb with recursive fraglist Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 034/116] ip6_vti: proper dev_{hold|put} in ndo_[un]init methods Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 035/116] can: dev: can_free_echo_skb(): don't crash the kernel if can_priv::echo_skb is accessed out of bounds Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 038/116] ice: handle increasing Tx or Rx ring sizes Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 040/116] net: usb: ax88179_178a: initialize local variables before use Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 043/116] selftests: mptcp: launch mptcp_connect with timeout Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 045/116] Bluetooth: Do not set cur_adv_instance in adv param MGMT request Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 049/116] mac80211: Set priority and queue mapping for injected frames Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 050/116] mac80211: clear the beacon's CRC after channel switch Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 052/116] net: phy: make PHY PM ops a no-op if MAC driver manages PHY PM Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 053/116] net: fec: use mac-managed " Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 055/116] rtw88: 8822c: add LC calibration for RTL8822C Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 056/116] mt76: mt7615: fix key set/delete issues Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 057/116] mt76: mt7615: support loading EEPROM for MT7613BE Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 058/116] mt76: mt76x0: disable GTK offloading Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 059/116] mt76: connac: always check return value from mt76_connac_mcu_alloc_wtbl_req Sasha Levin
2021-05-05 16:30 ` Sasha Levin [this message]
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 061/116] mt76: mt7915: fix key set/delete issue Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 062/116] mt76: mt7915: fix txpower init for TSSI off chips Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 063/116] mt76: mt7921: fix key set/delete issue Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 064/116] mt76: mt7915: add wifi subsystem reset Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 069/116] iwlwifi: pcie: make cfg vs. trans_cfg more robust Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 070/116] iwlwifi: queue: avoid memory leak in reset flow Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 071/116] iwlwifi: trans/pcie: defer transport initialisation Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 074/116] net: bridge: propagate error code and extack from br_mc_disabled_update Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 078/116] selftests: Set CC to clang in lib.mk if LLVM is set Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 084/116] sctp: Fix out-of-bounds warning in sctp_process_asconf_param() Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 085/116] flow_dissector: Fix out-of-bounds warning in __skb_flow_bpf_to_target() Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 088/116] wilc1000: Bring MAC address setting in line with typical Linux behavior Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 089/116] mac80211: properly drop the connection in case of invalid CSA IE Sasha Levin
2021-05-05 16:30 ` [PATCH AUTOSEL 5.12 091/116] ethtool: ioctl: Fix out-of-bounds warning in store_link_ksettings_for_user() Sasha Levin
2021-05-05 16:31 ` [PATCH AUTOSEL 5.12 092/116] net: sched: tapr: prevent cycle_time == 0 in parse_taprio_schedule Sasha Levin
2021-05-05 16:31 ` [PATCH AUTOSEL 5.12 093/116] samples/bpf: Fix broken tracex1 due to kprobe argument change Sasha Levin
2021-05-05 16:31 ` [PATCH AUTOSEL 5.12 098/116] mt76: mt7615: fix entering driver-own state on mt7663 Sasha Levin
2021-05-05 16:31 ` [PATCH AUTOSEL 5.12 100/116] wl3501_cs: Fix out-of-bounds warnings in wl3501_send_pkt Sasha Levin
2021-05-05 16:31 ` [PATCH AUTOSEL 5.12 101/116] wl3501_cs: Fix out-of-bounds warnings in wl3501_mgmt_join Sasha Levin
2021-05-05 16:31 ` [PATCH AUTOSEL 5.12 102/116] qtnfmac: Fix possible buffer overflow in qtnf_event_handle_external_auth Sasha Levin
2021-05-05 16:31 ` [PATCH AUTOSEL 5.12 104/116] iavf: remove duplicate free resources calls Sasha Levin
2021-05-05 16:31 ` [PATCH AUTOSEL 5.12 105/116] net: ethernet: mtk_eth_soc: fix RX VLAN offload Sasha Levin
2021-05-05 16:31 ` [PATCH AUTOSEL 5.12 106/116] selftests: mlxsw: Increase the tolerance of backlog buildup Sasha Levin
2021-05-05 16:31 ` [PATCH AUTOSEL 5.12 107/116] selftests: mlxsw: Fix mausezahn invocation in ERSPAN scale test Sasha Levin
2021-05-05 16:31 ` [PATCH AUTOSEL 5.12 109/116] bnxt_en: Add PCI IDs for Hyper-V VF devices Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210505163125.3460440-60-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).