diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2021-02-12 12:51:05 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-04-11 18:50:38 +0200 |
commit | baa3afb39e94965f4ca5b5d3d274379504b8fa24 (patch) | |
tree | be9ca42d806a26a25af5f599e7cdba8d11a78bf1 /drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | |
parent | 4b36cc6b390f18dbc59a45fb4141f90d7dfe2b23 (diff) | |
download | linux-stable-baa3afb39e94965f4ca5b5d3d274379504b8fa24.tar.gz linux-stable-baa3afb39e94965f4ca5b5d3d274379504b8fa24.tar.bz2 linux-stable-baa3afb39e94965f4ca5b5d3d274379504b8fa24.zip |
mt76: connac: always check return value from mt76_connac_mcu_alloc_wtbl_req
Even if this is not a real bug since mt76_connac_mcu_alloc_wtbl_req routine
can fails just if nskb is NULL , always check return value from
mt76_connac_mcu_alloc_wtbl_req in order to avoid possible future
mistake.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c index e6ad6cbeb803..ac8d6ad76054 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c @@ -833,6 +833,9 @@ int mt76_connac_mcu_add_sta_cmd(struct mt76_phy *phy, wtbl_hdr = mt76_connac_mcu_alloc_wtbl_req(dev, wcid, WTBL_RESET_AND_SET, sta_wtbl, &skb); + if (IS_ERR(wtbl_hdr)) + return PTR_ERR(wtbl_hdr); + if (enable) { mt76_connac_mcu_wtbl_generic_tlv(dev, skb, vif, sta, sta_wtbl, wtbl_hdr); |