diff options
author | Sean Wang <sean.wang@mediatek.com> | 2022-12-09 07:01:57 +0800 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-12-09 16:45:39 +0100 |
commit | 47180ecf4541146836c5307c1d5526f8ac6a5a6d (patch) | |
tree | 45f6e5f46662ad41ef7c3c90974677ef1ee8172b /drivers/net/wireless/mediatek/mt76/mt7921 | |
parent | 4493acad5b334ed0b45e374135acc6d6aaa9755c (diff) | |
download | linux-stable-47180ecf4541146836c5307c1d5526f8ac6a5a6d.tar.gz linux-stable-47180ecf4541146836c5307c1d5526f8ac6a5a6d.tar.bz2 linux-stable-47180ecf4541146836c5307c1d5526f8ac6a5a6d.zip |
wifi: mt76: mt7921: resource leaks at mt7921_check_offload_capability()
Fixed coverity issue with resource leaks at variable "fw" going out of
scope leaks the storage it points to mt7921_check_offload_capability().
Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1527806 ("Resource leaks")
Fixes: 034ae28b56f1 ("wifi: mt76: mt7921: introduce remain_on_channel support")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7921')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7921/init.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c index 542dfd425129..d4b681d7e1d2 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c @@ -175,7 +175,7 @@ u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm) if (!fw || !fw->data || fw->size < sizeof(*hdr)) { dev_err(dev, "Invalid firmware\n"); - return -EINVAL; + goto out; } data = fw->data; @@ -206,6 +206,7 @@ u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm) data += le16_to_cpu(rel_info->len) + rel_info->pad_len; } +out: release_firmware(fw); return features ? features->data : 0; |